TypeDescriptor.GetProperties Methode
Definition
Gibt die Auflistung von Eigenschaften für eine Komponente oder einen Typ zurück.Returns the collection of properties on a component or type.
Überlädt
GetProperties(Object, Attribute[], Boolean) |
Gibt die Auflistung der Eigenschaften für eine angegebene Komponente zurück. Hierbei wird ein angegebenes Array von Attributen als Filter sowie ein benutzerdefinierter Typdeskriptor verwendet.Returns the collection of properties for a specified component using a specified array of attributes as a filter and using a custom type descriptor. |
GetProperties(Object, Boolean) |
Gibt die Auflistung von Eigenschaften für eine angegebene Komponente zurück. Dazu wird der Standardtypdeskriptor verwendet.Returns the collection of properties for a specified component using the default type descriptor. |
GetProperties(Type, Attribute[]) |
Gibt die Auflistung der Eigenschaften für einen angegebenen Komponententyp zurück. Hierbei wird ein angegebenes Array von Attributen als Filter verwendet.Returns the collection of properties for a specified type of component using a specified array of attributes as a filter. |
GetProperties(Type) |
Gibt die Auflistung von Eigenschaften für einen angegebenen Komponententyp zurück.Returns the collection of properties for a specified type of component. |
GetProperties(Object) |
Gibt die Auflistung von Eigenschaften für eine angegebene Komponente zurück.Returns the collection of properties for a specified component. |
GetProperties(Object, Attribute[]) |
Gibt die Auflistung der Eigenschaften für eine angegebene Komponente zurück. Hierbei wird ein angegebenes Array von Attributen als Filter verwendet.Returns the collection of properties for a specified component using a specified array of attributes as a filter. |
GetProperties(Object, Attribute[], Boolean)
Gibt die Auflistung der Eigenschaften für eine angegebene Komponente zurück. Hierbei wird ein angegebenes Array von Attributen als Filter sowie ein benutzerdefinierter Typdeskriptor verwendet.Returns the collection of properties for a specified component using a specified array of attributes as a filter and using a custom type descriptor.
public:
static System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::Object ^ component, cli::array <Attribute ^> ^ attributes, bool noCustomTypeDesc);
public static System.ComponentModel.PropertyDescriptorCollection GetProperties (object component, Attribute[] attributes, bool noCustomTypeDesc);
static member GetProperties : obj * Attribute[] * bool -> System.ComponentModel.PropertyDescriptorCollection
Public Shared Function GetProperties (component As Object, attributes As Attribute(), noCustomTypeDesc As Boolean) As PropertyDescriptorCollection
Parameter
- component
- Object
Eine Komponente, deren Eigenschaften abgerufen werden sollen.A component to get the properties for.
- attributes
- Attribute[]
Ein Array des Typs Attribute, der als Filter verwendet werden soll.An array of type Attribute to use as a filter.
- noCustomTypeDesc
- Boolean
true
, um benutzerdefinierte Typbeschreibungsinformationen zu berücksichtigen, andernfalls false
.true
to consider custom type description information; otherwise, false
.
Gibt zurück
Ein PropertyDescriptorCollection mit den Ereignissen, die mit den angegebenen Attributen für die angegebene Komponente übereinstimmen.A PropertyDescriptorCollection with the events that match the specified attributes for the specified component.
Ausnahmen
component
ist ein prozessübergreifendes Remoteobjekt.component
is a cross-process remoted object.
Hinweise
Die Eigenschaften für einen component
können sich von den Eigenschaften einer Klasse unterscheiden, da die Site Eigenschaften hinzufügen oder entfernen kann, wenn die-Klasse gleich component
ist.The properties for a component
can differ from the properties of a class, because the site can add or remove properties if the component
is sited.
Das attributes
Parameter Array wird zum Filtern des Arrays verwendet.The attributes
parameter array is used to filter the array. Das Filtern wird durch die folgenden Regeln definiert:Filtering is defined by the following rules:
Wenn eine Eigenschaft nicht über eine Attribute der gleichen Klasse verfügt, ist die Eigenschaft nicht im zurückgegebenen Array enthalten.If a property does not have an Attribute of the same class, the property is not included in the returned array.
Wenn das-Attribut eine Instanz der- Attribute Klasse ist, muss die-Eigenschaft eine genaue Entsprechung aufweisen, oder Sie ist nicht im zurückgegebenen Array enthalten.If the attribute is an instance of the Attribute class, the property must be an exact match or it is not included in the returned array.
Wenn eine Attribute Instanz angegeben wird und es sich um die Standard Eigenschaft handelt, wird Sie in das zurückgegebene Array eingeschlossen, auch wenn keine Instanz von Attribute in der-Eigenschaft vorhanden ist.If an Attribute instance is specified and it is the default property, it is included in the returned array even if there is no instance of the Attribute in the property.
Wenn
attributes
über ein default-Attribut verfügt, stimmt die Methode mit der groß- GetProperties /Kleinschreibung überein, wenn die-Eigenschaft nicht über das-AttributIfattributes
has a default attribute, the GetProperties method matches the case when the property does not have the attribute applied.
Wenn der- component
Parameter ist null
, wird eine leere Auflistung zurückgegeben.If the component
parameter is null
, an empty collection is returned.
Es ist nicht garantiert, dass die Reihenfolge der zurückgegebenen Auflistung zwischen den aufrufen identisch ist, sodass Sie Sie immer vor der Verwendung sortieren müssen.The order of the returned collection is not guaranteed to be identical between calls, so always order it before use.
Siehe auch
- PropertyDescriptor
- PropertyDescriptorCollection
- ICustomTypeDescriptor
- GetProperties
- GetDefaultProperty
- CreateProperty
- GetAttributes
- GetEvents
Gilt für:
GetProperties(Object, Boolean)
Gibt die Auflistung von Eigenschaften für eine angegebene Komponente zurück. Dazu wird der Standardtypdeskriptor verwendet.Returns the collection of properties for a specified component using the default type descriptor.
public:
static System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::Object ^ component, bool noCustomTypeDesc);
public static System.ComponentModel.PropertyDescriptorCollection GetProperties (object component, bool noCustomTypeDesc);
static member GetProperties : obj * bool -> System.ComponentModel.PropertyDescriptorCollection
Public Shared Function GetProperties (component As Object, noCustomTypeDesc As Boolean) As PropertyDescriptorCollection
Parameter
- component
- Object
Eine Komponente, deren Eigenschaften abgerufen werden sollen.A component to get the properties for.
- noCustomTypeDesc
- Boolean
true
, um benutzerdefinierte Typbeschreibungsinformationen nicht zu berücksichtigen; anderenfalls false
.true
to not consider custom type description information; otherwise, false
.
Gibt zurück
Eine PropertyDescriptorCollection mit den Eigenschaften für eine angegebene Komponente.A PropertyDescriptorCollection with the properties for a specified component.
Ausnahmen
component
ist ein prozessübergreifendes Remoteobjekt.component
is a cross-process remoted object.
Hinweise
Die Eigenschaften für den- component
Parameter können sich von den Eigenschaften einer Klasse unterscheiden, da die Site Eigenschaften hinzufügen oder entfernen kann, wenn der component
Parameter "sited" ist.The properties for the component
parameter can differ from the properties of a class, because the site can add or remove properties if the component
parameter is sited.
Wenn den Wert component
null
hat, wird eine leere Auflistung zurückgegeben.If component
is null
, an empty collection is returned.
Es ist nicht garantiert, dass die Reihenfolge der zurückgegebenen Auflistung zwischen den aufrufen identisch ist, sodass Sie Sie immer vor der Verwendung sortieren müssen.The order of the returned collection is not guaranteed to be identical between calls, so always order it before use.
Siehe auch
- PropertyDescriptor
- PropertyDescriptorCollection
- ICustomTypeDescriptor
- GetProperties
- GetDefaultProperty
- CreateProperty
- GetAttributes
- GetEvents
Gilt für:
GetProperties(Type, Attribute[])
Gibt die Auflistung der Eigenschaften für einen angegebenen Komponententyp zurück. Hierbei wird ein angegebenes Array von Attributen als Filter verwendet.Returns the collection of properties for a specified type of component using a specified array of attributes as a filter.
public:
static System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(Type ^ componentType, cli::array <Attribute ^> ^ attributes);
public static System.ComponentModel.PropertyDescriptorCollection GetProperties (Type componentType, Attribute[] attributes);
static member GetProperties : Type * Attribute[] -> System.ComponentModel.PropertyDescriptorCollection
Public Shared Function GetProperties (componentType As Type, attributes As Attribute()) As PropertyDescriptorCollection
Parameter
- attributes
- Attribute[]
Ein Array des Typs Attribute, der als Filter verwendet werden soll.An array of type Attribute to use as a filter.
Gibt zurück
Ein PropertyDescriptorCollection mit den Eigenschaften, die mit den angegebenen Attributen für diesen Komponententyp übereinstimmen.A PropertyDescriptorCollection with the properties that match the specified attributes for this type of component.
Beispiele
Im folgenden Codebeispiel wird die Implementierung der- GetProperties Methode veranschaulicht.The following code example demonstrates how to implement the GetProperties method. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die-Klasse bereitgestellt wird PropertyTab .This code example is part of a larger example provided for the PropertyTab class.
// Returns the properties of the specified component extended with
// a CategoryAttribute reflecting the name of the type of the property.
[ReflectionPermission(SecurityAction::Demand, Flags=ReflectionPermissionFlag::MemberAccess)]
virtual System::ComponentModel::PropertyDescriptorCollection^ GetProperties( Object^ component, array<System::Attribute^>^attributes ) override
{
PropertyDescriptorCollection^ props;
if ( attributes == nullptr )
props = TypeDescriptor::GetProperties( component );
else
props = TypeDescriptor::GetProperties( component, attributes );
array<PropertyDescriptor^>^propArray = gcnew array<PropertyDescriptor^>(props->Count);
for ( int i = 0; i < props->Count; i++ )
{
// Create a new PropertyDescriptor from the old one, with
// a CategoryAttribute matching the name of the type.
array<Attribute^>^temp0 = {gcnew CategoryAttribute( props[ i ]->PropertyType->Name )};
propArray[ i ] = TypeDescriptor::CreateProperty( props[ i ]->ComponentType, props[ i ], temp0 );
}
return gcnew PropertyDescriptorCollection( propArray );
}
virtual System::ComponentModel::PropertyDescriptorCollection^ GetProperties( Object^ component ) override
{
return this->GetProperties( component, nullptr );
}
// Returns the properties of the specified component extended with
// a CategoryAttribute reflecting the name of the type of the property.
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(object component, System.Attribute[] attributes)
{
PropertyDescriptorCollection props;
if( attributes == null )
props = TypeDescriptor.GetProperties(component);
else
props = TypeDescriptor.GetProperties(component, attributes);
PropertyDescriptor[] propArray = new PropertyDescriptor[props.Count];
for(int i=0; i<props.Count; i++)
{
// Create a new PropertyDescriptor from the old one, with
// a CategoryAttribute matching the name of the type.
propArray[i] = TypeDescriptor.CreateProperty(props[i].ComponentType, props[i], new CategoryAttribute(props[i].PropertyType.Name));
}
return new PropertyDescriptorCollection( propArray );
}
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(object component)
{
return this.GetProperties(component, null);
}
' Returns the properties of the specified component extended with
' a CategoryAttribute reflecting the name of the type of the property.
Public Overloads Overrides Function GetProperties(ByVal component As Object, ByVal attributes() As System.Attribute) As System.ComponentModel.PropertyDescriptorCollection
Dim props As PropertyDescriptorCollection
If attributes Is Nothing Then
props = TypeDescriptor.GetProperties(component)
Else
props = TypeDescriptor.GetProperties(component, attributes)
End If
Dim propArray(props.Count - 1) As PropertyDescriptor
Dim i As Integer
For i = 0 To props.Count - 1
' Create a new PropertyDescriptor from the old one, with
' a CategoryAttribute matching the name of the type.
propArray(i) = TypeDescriptor.CreateProperty(props(i).ComponentType, props(i), New CategoryAttribute(props(i).PropertyType.Name))
Next i
Return New PropertyDescriptorCollection(propArray)
End Function
Public Overloads Overrides Function GetProperties(ByVal component As Object) As System.ComponentModel.PropertyDescriptorCollection
Return Me.GetProperties(component, Nothing)
End Function
Hinweise
Diese Version dieser Methode wird nur aufgerufen, wenn keine Instanz des-Objekts vorhanden ist.Call this version of this method only when you do not have an instance of the object.
Das attributes
Parameter Array wird zum Filtern des Arrays verwendet.The attributes
parameter array is used to filter the array. Das Filtern wird durch die folgenden Regeln definiert:Filtering is defined by the following rules:
Wenn eine Eigenschaft nicht über eine Attribute der gleichen Klasse verfügt, ist die Eigenschaft nicht im zurückgegebenen Array enthalten.If a property does not have an Attribute of the same class, the property is not included in the returned array.
Wenn das-Attribut eine Instanz der- Attribute Klasse ist, muss die-Eigenschaft eine genaue Entsprechung aufweisen, oder Sie ist nicht im zurückgegebenen Array enthalten.If the attribute is an instance of the Attribute class, the property must be an exact match or it is not included in the returned array.
Wenn eine Attribute Instanz angegeben wird und es sich um die Standard Eigenschaft handelt, wird Sie in das zurückgegebene Array eingeschlossen, auch wenn keine Instanz von Attribute in der-Eigenschaft vorhanden ist.If an Attribute instance is specified and it is the default property, it is included in the returned array even if there is no instance of the Attribute in the property.
Wenn
attributes
über ein default-Attribut verfügt, stimmt die Methode mit der groß- GetProperties /Kleinschreibung überein, wenn die-Eigenschaft nicht über das-AttributIfattributes
has a default attribute, the GetProperties method matches the case when the property does not have the attribute applied.
Wenn der- componentType
Parameter ist null
, wird eine leere Auflistung zurückgegeben.If the componentType
parameter is null
, an empty collection is returned.
Es ist nicht garantiert, dass die Reihenfolge der zurückgegebenen Auflistung zwischen den aufrufen identisch ist, sodass Sie Sie immer vor der Verwendung sortieren müssen.The order of the returned collection is not guaranteed to be identical between calls, so always order it before use.
Siehe auch
- PropertyDescriptor
- PropertyDescriptorCollection
- GetProperties
- GetDefaultProperty
- CreateProperty
- GetAttributes
- GetEvents
Gilt für:
GetProperties(Type)
Gibt die Auflistung von Eigenschaften für einen angegebenen Komponententyp zurück.Returns the collection of properties for a specified type of component.
public:
static System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(Type ^ componentType);
public static System.ComponentModel.PropertyDescriptorCollection GetProperties (Type componentType);
static member GetProperties : Type -> System.ComponentModel.PropertyDescriptorCollection
Public Shared Function GetProperties (componentType As Type) As PropertyDescriptorCollection
Parameter
- componentType
- Type
Ein Type, der die Komponente darstellt, für die Eigenschaften abgerufen werden sollen.A Type that represents the component to get properties for.
Gibt zurück
Eine PropertyDescriptorCollection mit den Eigenschaften für einen angegebenen Komponententyp.A PropertyDescriptorCollection with the properties for a specified type of component.
Hinweise
Diese Version dieser Methode wird nur aufgerufen, wenn keine Instanz des-Objekts vorhanden ist.Call this version of this method only when you do not have an instance of the object.
Wenn der- componentType
Parameter ist null
, wird eine leere Auflistung zurückgegeben.If the componentType
parameter is null
, an empty collection is returned.
Es ist nicht garantiert, dass die Reihenfolge der zurückgegebenen Auflistung zwischen den aufrufen identisch ist, sodass Sie Sie immer vor der Verwendung sortieren müssen.The order of the returned collection is not guaranteed to be identical between calls, so always order it before use.
Siehe auch
- PropertyDescriptor
- PropertyDescriptorCollection
- GetProperties
- GetDefaultProperty
- CreateProperty
- GetAttributes
- GetEvents
Gilt für:
GetProperties(Object)
Gibt die Auflistung von Eigenschaften für eine angegebene Komponente zurück.Returns the collection of properties for a specified component.
public:
static System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::Object ^ component);
public static System.ComponentModel.PropertyDescriptorCollection GetProperties (object component);
static member GetProperties : obj -> System.ComponentModel.PropertyDescriptorCollection
Public Shared Function GetProperties (component As Object) As PropertyDescriptorCollection
Parameter
- component
- Object
Eine Komponente, deren Eigenschaften abgerufen werden sollen.A component to get the properties for.
Gibt zurück
Eine PropertyDescriptorCollection mit den Eigenschaften für die angegebene Komponente.A PropertyDescriptorCollection with the properties for the specified component.
Ausnahmen
component
ist ein prozessübergreifendes Remoteobjekt.component
is a cross-process remoted object.
Beispiele
Im folgenden Codebeispiel wird die Verwendung der- GetProperties Methode für den Zugriff auf die Eigenschaften eines-Steuer Elements veranschaulicht.The following code example demonstrates the use of the GetProperties method to access the properties of a control. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die-Klasse bereitgestellt wird ComponentDesigner .This code example is part of a larger example provided for the ComponentDesigner class.
// This is the shadowed property on the designer.
// This value will be serialized instead of the
// value of the control's property.
public Color BackColor
{
get
{
return (Color)ShadowProperties["BackColor"];
}
set
{
if (this.changeService != null)
{
PropertyDescriptor backColorDesc =
TypeDescriptor.GetProperties(this.Control)["BackColor"];
this.changeService.OnComponentChanging(
this.Control,
backColorDesc);
this.ShadowProperties["BackColor"] = value;
this.changeService.OnComponentChanged(
this.Control,
backColorDesc,
null,
null);
}
}
}
' This is the shadowed property on the designer.
' This value will be serialized instead of the
' value of the control's property.
Public Property BackColor() As Color
Get
Return CType(ShadowProperties("BackColor"), Color)
End Get
Set(ByVal value As Color)
If (Me.changeService IsNot Nothing) Then
Dim backColorDesc As PropertyDescriptor = TypeDescriptor.GetProperties(Me.Control)("BackColor")
Me.changeService.OnComponentChanging(Me.Control, backColorDesc)
Me.ShadowProperties("BackColor") = value
Me.changeService.OnComponentChanged(Me.Control, backColorDesc, Nothing, Nothing)
End If
End Set
End Property
Hinweise
Die Eigenschaften einer Komponente können von den Eigenschaften einer Klasse abweichen, da die Site Eigenschaften hinzufügen oder entfernen kann, wenn die Komponente positioniert ist.The properties for a component can differ from the properties of a class, because the site can add or remove properties if the component is sited.
Wenn der- component
Parameter ist null
, wird eine leere Auflistung zurückgegeben.If the component
parameter is null
, an empty collection is returned.
Es ist nicht garantiert, dass die Reihenfolge der zurückgegebenen Auflistung zwischen den aufrufen identisch ist, sodass Sie Sie immer vor der Verwendung sortieren müssen.The order of the returned collection is not guaranteed to be identical between calls, so always order it before use.
Siehe auch
- PropertyDescriptor
- PropertyDescriptorCollection
- GetProperties
- GetDefaultProperty
- CreateProperty
- GetAttributes
- GetEvents
- Gewusst wie: Zugreifen auf Entwurfszeit DiensteHow to: Access Design-time Services
Gilt für:
GetProperties(Object, Attribute[])
Gibt die Auflistung der Eigenschaften für eine angegebene Komponente zurück. Hierbei wird ein angegebenes Array von Attributen als Filter verwendet.Returns the collection of properties for a specified component using a specified array of attributes as a filter.
public:
static System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::Object ^ component, cli::array <Attribute ^> ^ attributes);
public static System.ComponentModel.PropertyDescriptorCollection GetProperties (object component, Attribute[] attributes);
static member GetProperties : obj * Attribute[] -> System.ComponentModel.PropertyDescriptorCollection
Public Shared Function GetProperties (component As Object, attributes As Attribute()) As PropertyDescriptorCollection
Parameter
- component
- Object
Eine Komponente, deren Eigenschaften abgerufen werden sollen.A component to get the properties for.
- attributes
- Attribute[]
Ein Array des Typs Attribute, der als Filter verwendet werden soll.An array of type Attribute to use as a filter.
Gibt zurück
Eine PropertyDescriptorCollection mit den Eigenschaften, die mit den angegebenen Attributen für die angegebene Komponente übereinstimmen.A PropertyDescriptorCollection with the properties that match the specified attributes for the specified component.
Ausnahmen
component
ist ein prozessübergreifendes Remoteobjekt.component
is a cross-process remoted object.
Beispiele
Im folgenden Codebeispiel wird die Implementierung der- GetProperties Methode veranschaulicht.The following code example demonstrates how to implement the GetProperties method. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die-Klasse bereitgestellt wird PropertyTab .This code example is part of a larger example provided for the PropertyTab class.
// Returns the properties of the specified component extended with
// a CategoryAttribute reflecting the name of the type of the property.
[ReflectionPermission(SecurityAction::Demand, Flags=ReflectionPermissionFlag::MemberAccess)]
virtual System::ComponentModel::PropertyDescriptorCollection^ GetProperties( Object^ component, array<System::Attribute^>^attributes ) override
{
PropertyDescriptorCollection^ props;
if ( attributes == nullptr )
props = TypeDescriptor::GetProperties( component );
else
props = TypeDescriptor::GetProperties( component, attributes );
array<PropertyDescriptor^>^propArray = gcnew array<PropertyDescriptor^>(props->Count);
for ( int i = 0; i < props->Count; i++ )
{
// Create a new PropertyDescriptor from the old one, with
// a CategoryAttribute matching the name of the type.
array<Attribute^>^temp0 = {gcnew CategoryAttribute( props[ i ]->PropertyType->Name )};
propArray[ i ] = TypeDescriptor::CreateProperty( props[ i ]->ComponentType, props[ i ], temp0 );
}
return gcnew PropertyDescriptorCollection( propArray );
}
virtual System::ComponentModel::PropertyDescriptorCollection^ GetProperties( Object^ component ) override
{
return this->GetProperties( component, nullptr );
}
// Returns the properties of the specified component extended with
// a CategoryAttribute reflecting the name of the type of the property.
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(object component, System.Attribute[] attributes)
{
PropertyDescriptorCollection props;
if( attributes == null )
props = TypeDescriptor.GetProperties(component);
else
props = TypeDescriptor.GetProperties(component, attributes);
PropertyDescriptor[] propArray = new PropertyDescriptor[props.Count];
for(int i=0; i<props.Count; i++)
{
// Create a new PropertyDescriptor from the old one, with
// a CategoryAttribute matching the name of the type.
propArray[i] = TypeDescriptor.CreateProperty(props[i].ComponentType, props[i], new CategoryAttribute(props[i].PropertyType.Name));
}
return new PropertyDescriptorCollection( propArray );
}
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(object component)
{
return this.GetProperties(component, null);
}
' Returns the properties of the specified component extended with
' a CategoryAttribute reflecting the name of the type of the property.
Public Overloads Overrides Function GetProperties(ByVal component As Object, ByVal attributes() As System.Attribute) As System.ComponentModel.PropertyDescriptorCollection
Dim props As PropertyDescriptorCollection
If attributes Is Nothing Then
props = TypeDescriptor.GetProperties(component)
Else
props = TypeDescriptor.GetProperties(component, attributes)
End If
Dim propArray(props.Count - 1) As PropertyDescriptor
Dim i As Integer
For i = 0 To props.Count - 1
' Create a new PropertyDescriptor from the old one, with
' a CategoryAttribute matching the name of the type.
propArray(i) = TypeDescriptor.CreateProperty(props(i).ComponentType, props(i), New CategoryAttribute(props(i).PropertyType.Name))
Next i
Return New PropertyDescriptorCollection(propArray)
End Function
Public Overloads Overrides Function GetProperties(ByVal component As Object) As System.ComponentModel.PropertyDescriptorCollection
Return Me.GetProperties(component, Nothing)
End Function
Hinweise
Die Eigenschaften für den- component
Parameter können sich von den Eigenschaften einer Klasse unterscheiden, da die Site Eigenschaften hinzufügen oder entfernen kann, wenn der component
Parameter "sited" ist.The properties for the component
parameter can differ from the properties of a class, because the site can add or remove properties if the component
parameter is sited.
Das attributes
Parameter Array wird zum Filtern des Arrays verwendet.The attributes
parameter array is used to filter the array. Das Filtern wird durch die folgenden Regeln definiert:Filtering is defined by the following rules:
Wenn eine Eigenschaft nicht über eine Attribute der gleichen Klasse verfügt, ist die Eigenschaft nicht im zurückgegebenen Array enthalten.If a property does not have an Attribute of the same class, the property is not included in the returned array.
Wenn das-Attribut eine Instanz der- Attribute Klasse ist, muss die-Eigenschaft eine genaue Entsprechung aufweisen, oder Sie ist nicht im zurückgegebenen Array enthalten.If the attribute is an instance of the Attribute class, the property must be an exact match or it is not included in the returned array.
Wenn eine Attribute Instanz angegeben wird und es sich um die Standard Eigenschaft handelt, wird Sie in das zurückgegebene Array eingeschlossen, auch wenn keine Instanz von Attribute in der-Eigenschaft vorhanden ist.If an Attribute instance is specified and it is the default property, it is included in the returned array even if there is no instance of the Attribute in the property.
Wenn
attributes
über ein default-Attribut verfügt, stimmt die Methode mit der groß- GetProperties /Kleinschreibung überein, wenn die-Eigenschaft nicht über das-AttributIfattributes
has a default attribute, the GetProperties method matches the case when the property does not have the attribute applied.
Wenn den Wert component
null
hat, wird eine leere Auflistung zurückgegeben.If component
is null
, an empty collection is returned.
Es ist nicht garantiert, dass die Reihenfolge der zurückgegebenen Auflistung zwischen den aufrufen identisch ist, sodass Sie Sie immer vor der Verwendung sortieren müssen.The order of the returned collection is not guaranteed to be identical between calls, so always order it before use.
Siehe auch
- PropertyDescriptor
- PropertyDescriptorCollection
- GetProperties
- GetDefaultProperty
- CreateProperty
- GetAttributes
- GetEvents