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.

C#
public AttributeProviderAttribute(string typeName);

Parameters

typeName
String

The name of the type to specify.

Exceptions

typeName is null.

See also

Applies to

.NET 10 och andra versioner
Produkt Versioner
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

AttributeProviderAttribute(Type)

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

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

C#
public AttributeProviderAttribute(Type 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.

C#
[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;
    }
}

See also

Applies to

.NET 10 och andra versioner
Produkt Versioner
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

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.

C#
public AttributeProviderAttribute(string typeName, string propertyName);

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

.NET 10 och andra versioner
Produkt Versioner
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1