AttributeProviderAttribute Konstruktor

Definisi

Menginisialisasi instans baru kelas AttributeProviderAttribute.

Overload

AttributeProviderAttribute(String)

Menginisialisasi instans AttributeProviderAttribute baru kelas dengan nama jenis yang diberikan.

AttributeProviderAttribute(Type)

Menginisialisasi instans AttributeProviderAttribute baru kelas dengan jenis yang diberikan.

AttributeProviderAttribute(String, String)

Menginisialisasi instans AttributeProviderAttribute baru kelas dengan nama jenis dan nama properti yang diberikan.

AttributeProviderAttribute(String)

Sumber:
AttributeProviderAttribute.cs
Sumber:
AttributeProviderAttribute.cs
Sumber:
AttributeProviderAttribute.cs

Menginisialisasi instans AttributeProviderAttribute baru kelas dengan nama jenis yang diberikan.

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

Parameter

typeName
String

Nama jenis yang akan ditentukan.

Pengecualian

typeNameadalah null.

Lihat juga

Berlaku untuk

AttributeProviderAttribute(Type)

Sumber:
AttributeProviderAttribute.cs
Sumber:
AttributeProviderAttribute.cs
Sumber:
AttributeProviderAttribute.cs

Menginisialisasi instans AttributeProviderAttribute baru kelas dengan jenis yang diberikan.

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

Parameter

type
Type

Jenis yang akan ditentukan.

Pengecualian

typeadalah null.

Contoh

Contoh kode berikut menunjukkan penggunaan AttributeProviderAttribute untuk menandai DataSource properti dengan jenis tertentu.IListSource Untuk daftar kode lengkap, lihat Cara: Menerapkan Atribut di kontrol Formulir Windows.

[Category("Data")]
[Description("Indicates the source of data for the control.")]
[RefreshProperties(RefreshProperties.Repaint)]
[AttributeProvider(typeof(IListSource))]
public object DataSource
{
    get
    {
        return this.dataGridView1.DataSource;
    }

    set
    {
        this.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

Lihat juga

Berlaku untuk

AttributeProviderAttribute(String, String)

Sumber:
AttributeProviderAttribute.cs
Sumber:
AttributeProviderAttribute.cs
Sumber:
AttributeProviderAttribute.cs

Menginisialisasi instans AttributeProviderAttribute baru kelas dengan nama jenis dan nama properti yang diberikan.

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)

Parameter

typeName
String

Nama jenis yang akan ditentukan.

propertyName
String

Nama properti yang atributnya akan diambil.

Pengecualian

propertyNameadalah null.

Lihat juga

Berlaku untuk