Attribute specifying names and descriptions for object properties

Namespace: ININ.IceLib.Configuration.Dialer
Assembly: ININ.IceLib.Dialer (in ININ.IceLib.Dialer.dll) Version: 0.0.0.0 (22.3.0.208)

Syntax

C#
public class PropertyDescriptionAttribute : Attribute
Visual Basic
Public Class PropertyDescriptionAttribute _
	Inherits Attribute

Examples

This sample shows how to retrieve a description for a campaign property.
CopyC#
public string GetCampaignPropertyDescription(CampaignConfiguration.Property property)
{
    System.Reflection.FieldInfo targetField = typeof(CampaignConfiguration.Property).GetField(property.ToString());
    object[] attributes = targetField.GetCustomAttributes(typeof(PropertyDescriptionAttribute), false);

    //return an empty string if the property doesn't have a property description attribute
    if (attributes.Length == 0)
        return string.empty;

    PropertyDescriptionAttribute propertyDescription = (PropertyDescriptionAttribute)attributes[0];
    return propertyDescription.Description;
}

Inheritance Hierarchy

System..::..Object
  System..::..Attribute
    ININ.IceLib.Configuration.Dialer..::..PropertyDescriptionAttribute

See Also