AttributeProviderAttribute Конструкторы

Определение

Инициализирует новый экземпляр класса AttributeProviderAttribute.

Перегрузки

Имя Описание
AttributeProviderAttribute(String)

Инициализирует новый экземпляр AttributeProviderAttribute класса с заданным именем типа.

AttributeProviderAttribute(Type)

Инициализирует новый экземпляр AttributeProviderAttribute класса с заданным типом.

AttributeProviderAttribute(String, String)

Инициализирует новый экземпляр AttributeProviderAttribute класса с заданным именем типа и именем свойства.

AttributeProviderAttribute(String)

Исходный код:
AttributeProviderAttribute.cs
Исходный код:
AttributeProviderAttribute.cs
Исходный код:
AttributeProviderAttribute.cs
Исходный код:
AttributeProviderAttribute.cs
Исходный код:
AttributeProviderAttribute.cs

Инициализирует новый экземпляр AttributeProviderAttribute класса с заданным именем типа.

public:
 AttributeProviderAttribute(System::String ^ typeName);
public AttributeProviderAttribute(string typeName);
new System.ComponentModel.AttributeProviderAttribute : string -> System.ComponentModel.AttributeProviderAttribute
Public Sub New (typeName As String)

Параметры

typeName
String

Имя указанного типа.

Исключения

typeName равно null.

См. также раздел

Применяется к

AttributeProviderAttribute(Type)

Исходный код:
AttributeProviderAttribute.cs
Исходный код:
AttributeProviderAttribute.cs
Исходный код:
AttributeProviderAttribute.cs
Исходный код:
AttributeProviderAttribute.cs
Исходный код:
AttributeProviderAttribute.cs

Инициализирует новый экземпляр AttributeProviderAttribute класса с заданным типом.

public:
 AttributeProviderAttribute(Type ^ type);
public AttributeProviderAttribute(Type type);
new System.ComponentModel.AttributeProviderAttribute : Type -> System.ComponentModel.AttributeProviderAttribute
Public Sub New (type As Type)

Параметры

type
Type

Тип, который нужно указать.

Исключения

type равно null.

Примеры

В следующем примере кода показано, как пометить AttributeProviderAttributeDataSource свойство с определенным типом IListSource. Полный список кода см. в разделе How to: Apply Attributes in Windows Forms Controls.

[Category("Data")]
[Description("Indicates the source of data for the control.")]
[RefreshProperties(RefreshProperties.Repaint)]
[AttributeProvider(typeof(IListSource))]
public object DataSource
{
    get => _dataGridView1.DataSource;
    set => _dataGridView1.DataSource = value;
}
<Category("Data"), _
Description("Indicates the source of data for the control."), _
RefreshProperties(RefreshProperties.Repaint), _
AttributeProvider(GetType(IListSource))> _
Public Property DataSource() As Object
    Get
        Return Me.dataGridView1.DataSource
    End Get

    Set(ByVal value As Object)
        Me.dataGridView1.DataSource = value
    End Set
End Property

См. также раздел

Применяется к

AttributeProviderAttribute(String, String)

Исходный код:
AttributeProviderAttribute.cs
Исходный код:
AttributeProviderAttribute.cs
Исходный код:
AttributeProviderAttribute.cs
Исходный код:
AttributeProviderAttribute.cs
Исходный код:
AttributeProviderAttribute.cs

Инициализирует новый экземпляр AttributeProviderAttribute класса с заданным именем типа и именем свойства.

public:
 AttributeProviderAttribute(System::String ^ typeName, System::String ^ propertyName);
public AttributeProviderAttribute(string typeName, string propertyName);
new System.ComponentModel.AttributeProviderAttribute : string * string -> System.ComponentModel.AttributeProviderAttribute
Public Sub New (typeName As String, propertyName As String)

Параметры

typeName
String

Имя указанного типа.

propertyName
String

Имя свойства, для которого будут извлечены атрибуты.

Исключения

propertyName равно null.

См. также раздел

Применяется к