Επεξεργασία

Κοινή χρήση μέσω


AttributeProviderAttribute Constructors

Definition

Initializes a new instance of the AttributeProviderAttribute class.

Overloads

AttributeProviderAttribute(String)

Initializes a new instance of the AttributeProviderAttribute class with the given type name.

AttributeProviderAttribute(Type)

Initializes a new instance of the AttributeProviderAttribute class with the given type.

AttributeProviderAttribute(String, String)

Initializes a new instance of the AttributeProviderAttribute class with the given type name and property name.

AttributeProviderAttribute(String)

Source:
AttributeProviderAttribute.cs
Source:
AttributeProviderAttribute.cs
Source:
AttributeProviderAttribute.cs

Initializes a new instance of the AttributeProviderAttribute class with the given type name.

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

Parameters

typeName
String

The name of the type to specify.

Exceptions

typeName is null.

See also

Applies to

AttributeProviderAttribute(Type)

Source:
AttributeProviderAttribute.cs
Source:
AttributeProviderAttribute.cs
Source:
AttributeProviderAttribute.cs

Initializes a new instance of the AttributeProviderAttribute class with the given type.

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

Parameters

type
Type

The type to specify.

Exceptions

type is null.

Examples

The following code example demonstrates using AttributeProviderAttribute to mark a DataSource property with a specific type of IListSource. For a full code listing, see 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
    {
        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

See also

Applies to

AttributeProviderAttribute(String, String)

Source:
AttributeProviderAttribute.cs
Source:
AttributeProviderAttribute.cs
Source:
AttributeProviderAttribute.cs

Initializes a new instance of the AttributeProviderAttribute class with the given type name and property name.

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)

Parameters

typeName
String

The name of the type to specify.

propertyName
String

The name of the property for which attributes will be retrieved.

Exceptions

propertyName is null.

See also

Applies to