[DefaultValue(Color.Black)]
属性实参必须是属性形参类型的常量表达式、typeof 表达式或数组创建表达式尝试过
[DefaultValue(typeof(Color),"Red")]
但是似乎.net cf 不支持这种写法。求教大师
属性实参必须是属性形参类型的常量表达式、typeof 表达式或数组创建表达式尝试过
[DefaultValue(typeof(Color),"Red")]
但是似乎.net cf 不支持这种写法。求教大师
{
// 摘要:
// Specifies the default value for a property.
[AttributeUsage(AttributeTargets.All)]
public sealed class DefaultValueAttribute : Attribute
{
// 摘要:
// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute
// class using a System.Boolean value.
//
// 参数:
// value:
// A System.Boolean that is the default value.
public DefaultValueAttribute(bool value);
//
// 摘要:
// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute
// class using an 8-bit unsigned integer.
//
// 参数:
// value:
// An 8-bit unsigned integer that is the default value.
public DefaultValueAttribute(byte value);
//
// 摘要:
// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute
// class using a Unicode character.
//
// 参数:
// value:
// A Unicode character that is the default value.
public DefaultValueAttribute(char value);
//
// 摘要:
// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute
// class using a double-precision floating point number.
//
// 参数:
// value:
// A double-precision floating point number that is the default value.
public DefaultValueAttribute(double value);
//
// 摘要:
// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute
// class using a single-precision floating point number.
//
// 参数:
// value:
// A single-precision floating point number that is the default value.
public DefaultValueAttribute(float value);
//
// 摘要:
// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute
// class using a 32-bit signed integer.
//
// 参数:
// value:
// A 32-bit signed integer that is the default value.
public DefaultValueAttribute(int value);
//
// 摘要:
// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute
// class using a 64-bit signed integer.
//
// 参数:
// value:
// A 64-bit signed integer that is the default value.
public DefaultValueAttribute(long value);
//
// 摘要:
// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute
// class.
//
// 参数:
// value:
// An System.Object that represents the default value.
public DefaultValueAttribute(object value);
//
// 摘要:
// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute
// class using a 16-bit signed integer.
//
// 参数:
// value:
// A 16-bit signed integer that is the default value.
public DefaultValueAttribute(short value);
//
// 摘要:
// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute
// class using a System.String.
//
// 参数:
// value:
// A System.String that is the default value.
public DefaultValueAttribute(string value); // 摘要:
// Gets the default value of the property this attribute is bound to.
//
// 返回结果:
// An System.Object that represents the default value of the property this attribute
// is bound to.
public object Value { get; } // 摘要:
// Returns whether the value of the given object is equal to the current System.ComponentModel.DefaultValueAttribute.
//
// 参数:
// obj:
// The object to test the value equality of.
//
// 返回结果:
// true if the value of the given object is equal to that of the current; otherwise,
// false.
public override bool Equals(object obj);
public override int GetHashCode();
}
}