Поделиться через


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 и/или typenullссылка NULL (Nothing в Visual Basic).

ArgumentException

Указанное свойство уже существует.

Безопасность платформы .NET Framework

См. также

Ссылки

DataConnectionProperties Класс

AddProperty - перегрузка

Microsoft.VisualStudio.Data.Framework - пространство имен

RemoveProperty