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

动态添加新的属性。DataConnectionProperties 类的当前实例本身识别的属性集合。

命名空间:  Microsoft.VisualStudio.Data.Framework
程序集:  Microsoft.VisualStudio.Data.Framework(在 Microsoft.VisualStudio.Data.Framework.dll 中)

语法

声明
Protected Function AddProperty ( _
    descriptor As PropertyDescriptor, _
    ParamArray attributes As Attribute() _
) As PropertyDescriptor
protected PropertyDescriptor AddProperty(
    PropertyDescriptor descriptor,
    params Attribute[] attributes
)
protected:
PropertyDescriptor^ AddProperty(
    PropertyDescriptor^ descriptor, 
    ... array<Attribute^>^ attributes
)
member AddProperty : 
        descriptor:PropertyDescriptor * 
        attributes:Attribute[] -> PropertyDescriptor
protected function AddProperty(
    descriptor : PropertyDescriptor, 
    ... attributes : Attribute[]
) : PropertyDescriptor

参数

  • descriptor
    类型:PropertyDescriptor

    提供此属性及其特性的 PropertyDescriptor 对象。

  • attributes
    类型:array<Attribute[]

    应用于属性的特性。

返回值

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

异常

异常 条件
ArgumentNullException

descriptor 参数为 nullnull 引用(在 Visual Basic 中为 Nothing)。

ArgumentException

指定属性已经存在。

备注

输入属性描述符。的专用连接属性描述符,包装,因此返回值实际上是通过的查询不同的 PropertyDescriptor 实例。

.NET Framework 安全性

请参阅

参考

DataConnectionProperties 类

AddProperty 重载

Microsoft.VisualStudio.Data.Framework 命名空间

RemoveProperty