AdvantageCMS.Core.Common.BaseClasses Namespace
Advantage CSP

LocalDescription Class

Allows for creation of customized language specific "DescriptionAttribute" for enumerations to be used with enum.GetDescription() Implements the Attribute

Namespace:  AdvantageCMS.Core.Common.Extension
Assembly:  AdvantageCMS.Core (in AdvantageCMS.Core.dll)

Syntax


[AttributeUsageAttribute]
public class LocalDescription : Attribute

Examples


Example declaration of an enum using System.Component.Attribute "Description" and Advantage.Core.Common.Extension.LocalDescription "LocalDescription"

C#
public enum eExampleEnum
{
//Returns back the name of the enum (None)
None = 0,
//you can use partial culture codes!
[LocalDescription("en", "Good Entry"), LocalDescription("fr", "Bonne entrée")]
Good = 1,
//If spanish, it will pickup the Localized entry, otherwise default
[Description("Bad Entry")]
[LocalDescription("es", "Mala entrada")]
Bad = 2,
//Will always return the LocalDescription when English...Other culture codes return default
[Description("Default Entry")]
[LocalDescription("en", "Entry English")]
Entry = 3
}

Inheritance Hierarchy


Object
  Attribute
    AdvantageCMS.Core.Common.Extension..::..LocalDescription