DataConnectionProperties.AddProperty 方法 (String, Type, array<Attribute )

动态添加一个新属性。此数据连接属性实例本身识别的属性集合。

命名空间:  Microsoft.VisualStudio.Data
程序集:  Microsoft.VisualStudio.Data(在 Microsoft.VisualStudio.Data.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

参数

返回值

类型:System.ComponentModel.PropertyDescriptor
新添加的属性的类型描述符。

异常

异常 条件
ArgumentNullException

name 和 type 参数为null。

InvalidOperationException

所指定的属性已存在。

.NET Framework 安全性

请参见

参考

DataConnectionProperties 类

AddProperty 重载

Microsoft.VisualStudio.Data 命名空间

RemoveProperty