动态添加新的属性到此数据连接属性实例本身识别的属性集合。
命名空间: Microsoft.VisualStudio.Data.Framework
程序集: Microsoft.VisualStudio.Data.Framework(在 Microsoft.VisualStudio.Data.Framework.dll 中)
语法
声明
Protected Function AddProperty ( _
name As String, _
type As Type, _
ParamArray attributes As Attribute() _
) As PropertyDescriptor
protected PropertyDescriptor AddProperty(
string name,
Type type,
params Attribute[] attributes
)
protected:
PropertyDescriptor^ AddProperty(
String^ name,
Type^ type,
... array<Attribute^>^ attributes
)
member AddProperty :
name:string *
type:Type *
attributes:Attribute[] -> PropertyDescriptor
protected function AddProperty(
name : String,
type : Type,
... attributes : Attribute[]
) : PropertyDescriptor
参数
name
类型:String属性名称。
type
类型:Type属性的数据类型。
attributes
类型:array<Attribute[]附加的特性的属性。
返回值
类型:PropertyDescriptor
新添加的属性描述符。
异常
异常 | 条件 |
---|---|
ArgumentNullException | name 和 type 参数为 nullnull 引用(在 Visual Basic 中为 Nothing)。 |
ArgumentException | 指定属性已经存在。 |
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关详细信息,请参阅通过部分受信任的代码使用库。