New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets for: Robert Andersson
C#
int intValue = 1512;
string stringValue = intValue.ToString("#,#", CultureInfo.GetCultureInfo(Thread.CurrentThread.CurrentCulture.Name));
/* Result in US English (en-US) will be 1,512
   Result in Swedish (sv-SE) will be 1 512 */
by Robert Andersson   April 29, 2010 @ 4:53am
58 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>();
117 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>();
by Robert Andersson   March 11, 2010 @ 12:25pm
71 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)
153 Views
no 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)
   {
178 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