#if NET_2_0
namespace System.ComponentModel
{
- [AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Event)]
+ [AttributeUsageAttribute (AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event)]
public class DisplayNameAttribute : Attribute
{
public static readonly DisplayNameAttribute Default = new DisplayNameAttribute ();
public DisplayNameAttribute (string displayName)
{
- this.attributeDisplayName = displayName != null ? displayName : String.Empty;
+ this.attributeDisplayName = displayName;
}
public override bool IsDefaultAttribute ()
{
- return attributeDisplayName.Length == 0;
+ if (attributeDisplayName != null)
+ return attributeDisplayName.Length == 0;
+ return false;
}
public override int GetHashCode ()
protected string DisplayNameValue {
get { return attributeDisplayName; }
- set { attributeDisplayName = value != null ? value : String.Empty; }
+ set { attributeDisplayName = value; }
}
}
}