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

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

命名空间:  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 安全性

请参阅

参考

DataConnectionProperties 类

AddProperty 重载

Microsoft.VisualStudio.Data.Framework 命名空间

RemoveProperty