CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of EPiServer
C#
using System;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using EPiServer;
using EPiServer.ClientScript;
using EPiServer.Core;
using EPiServer.Editor;
 
namespace MyProject
{
by rawbert   May 19, 2011 @ 12:50am
183 Views
no comments
 
C#
/// <summary>
/// Get the file that will be read/written to
/// </summary>
/// <returns></returns>
public UnifiedFile GetFileFromProperty(PageData page, string propertyName)
{
    var filePath = page.Property[propertyName] != null
                       ? (string)page.Property[propertyName].Value
                       : string.Empty;
    if (string.IsNullOrEmpty(filePath)) return null;
by rawbert   February 25, 2011 @ 12:45am
218 Views
no comments
 
C#
/// <summary>
/// Return all properties from a type up to a specified base type in the inheritance hierarchy
/// </summary>
/// <param name="type">Type that will be examined</param>
/// <param name="baseType">Where to stop in the inheritance hierarchy. Must be a type that first parameter inherits from
/// </param>
/// <returns>A list of all found properties</returns>
public static List<PropertyInfo> GetAllProperties(Type type, Type baseType)
{
   List<PropertyInfo> properties = new List<PropertyInfo>();
438 Views
no comments
 
C#
/// <summary>
/// Creates a string list that contains the hierrarchy leading to the current page
/// </summary>
/// <param name="currentPage"></param>
/// <param name="ReplaceStartWithLangCode"></param>
/// <param name="ReverseSort"></param>
/// <returns></returns>
public static List<string> GetBreadCrumb(PageData currentPage, bool ReplaceStartWithLangCode, bool ReverseSort)
{
   if (currentPage != null)
555 Views
no comments
 
C#
// Extension method for retrieving a page from a PageReference
// For example:
// PageData parent = CurrentPage.ParentLink.GetPage()
public static PageData GetPage(this PageReference link)
{
    if (link==PageReference.EmptyReference)
        return null;
 
    return DataFactory.Instance.GetPage(link);
}
by Ted Nyberg   December 08, 2009 @ 8:02am
196 Views
1 comments
 
C#
/// <summary>
/// Get all pages from the LinkItemCollection property
/// </summary>
/// <returns>PageDataCollection</returns>
public PageDataCollection GetLinkCollectionPages(string propertyName)
{
   PageDataCollection pages = new PageDataCollection();
   LinkItemCollection links = CurrentPage[propertyName] != null ? CurrentPage.Property[propertyName].Value as LinkItemCollection : null;
   if (links != null)
   {
478 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate