TypeDescriptor.AddAttributes Metoda

Definicja

Dodaje atrybuty na poziomie klasy do składnika docelowego.

Przeciążenia

AddAttributes(Object, Attribute[])

Dodaje atrybuty na poziomie klasy do wystąpienia składnika docelowego.

AddAttributes(Type, Attribute[])

Dodaje atrybuty na poziomie klasy do typu składnika docelowego.

AddAttributes(Object, Attribute[])

Źródło:
TypeDescriptor.cs
Źródło:
TypeDescriptor.cs
Źródło:
TypeDescriptor.cs

Dodaje atrybuty na poziomie klasy do wystąpienia składnika docelowego.

public:
 static System::ComponentModel::TypeDescriptionProvider ^ AddAttributes(System::Object ^ instance, ... cli::array <Attribute ^> ^ attributes);
public static System.ComponentModel.TypeDescriptionProvider AddAttributes (object instance, params Attribute[] attributes);
static member AddAttributes : obj * Attribute[] -> System.ComponentModel.TypeDescriptionProvider
Public Shared Function AddAttributes (instance As Object, ParamArray attributes As Attribute()) As TypeDescriptionProvider

Parametry

instance
Object

Wystąpienie składnika docelowego.

attributes
Attribute[]

Tablica Attribute obiektów do dodania do klasy składnika.

Zwraca

Nowo utworzony element TypeDescriptionProvider , który został użyty do dodania określonych atrybutów.

Wyjątki

Jeden lub oba parametry to null.

Uwagi

Metoda AddAttributes(Object, Attribute[]) dodaje atrybuty na poziomie klasy do określonego wystąpienia składnika. Ponieważ jest to typowe wymaganie aplikacji korzystających z programu Visual Studio Windows Forms Designer i okno Właściwości, ta metoda udostępnia skrót, tworząc dostawcę opisu typu, który scala podane atrybuty z atrybutami, które już istnieją w klasie. Wartość zwracana jest dostawcą opisu typu, który został użyty do dodania atrybutów. Ten dostawca można później przekazać do RemoveProvider(TypeDescriptionProvider, Object) metody, gdy dodane atrybuty nie będą już potrzebne.

Zobacz też

Dotyczy

AddAttributes(Type, Attribute[])

Źródło:
TypeDescriptor.cs
Źródło:
TypeDescriptor.cs
Źródło:
TypeDescriptor.cs

Dodaje atrybuty na poziomie klasy do typu składnika docelowego.

public:
 static System::ComponentModel::TypeDescriptionProvider ^ AddAttributes(Type ^ type, ... cli::array <Attribute ^> ^ attributes);
public static System.ComponentModel.TypeDescriptionProvider AddAttributes (Type type, params Attribute[] attributes);
static member AddAttributes : Type * Attribute[] -> System.ComponentModel.TypeDescriptionProvider
Public Shared Function AddAttributes (type As Type, ParamArray attributes As Attribute()) As TypeDescriptionProvider

Parametry

type
Type

Składnik Type docelowy.

attributes
Attribute[]

Tablica Attribute obiektów do dodania do klasy składnika.

Zwraca

Nowo utworzony element TypeDescriptionProvider , który został użyty do dodania określonych atrybutów.

Wyjątki

Jeden lub oba parametry to null.

Uwagi

Metoda AddAttributes(Type, Attribute[]) dodaje atrybuty na poziomie klasy do określonego typu składnika. Ponieważ jest to typowe wymaganie aplikacji korzystających z programu Visual Studio Windows Forms Designer i okno Właściwości, ta metoda udostępnia skrót, tworząc dostawcę opisu typu, który scala podane atrybuty z atrybutami, które już istnieją w klasie. Wartość zwracana jest dostawcą opisu typu, który został użyty do dodania atrybutów. Ten dostawca można później przekazać do RemoveProvider(TypeDescriptionProvider, Type) metody, gdy dodane atrybuty nie będą już potrzebne.

Zobacz też

Dotyczy