PropertyGridObject.ICustomTypeDescriptor.GetProperties Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the properties for the property grid.
Overloads
ICustomTypeDescriptor.GetProperties() |
Returns the properties for the property grid. |
ICustomTypeDescriptor.GetProperties(Attribute[]) |
Returns the properties for the property grid, using the specified attribute array as a filter. |
ICustomTypeDescriptor.GetProperties()
Returns the properties for the property grid.
virtual System::ComponentModel::PropertyDescriptorCollection ^ System.ComponentModel.ICustomTypeDescriptor.GetProperties() = System::ComponentModel::ICustomTypeDescriptor::GetProperties;
System.ComponentModel.PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties ();
Function GetProperties () As PropertyDescriptorCollection Implements ICustomTypeDescriptor.GetProperties
Returns
A PropertyDescriptorCollection object that represents the properties for the property grid.
Implements
Examples
The following example duplicates the <xref:Microsoft.Web.Management.Client.PropertyGridObject.System.ComponentModel.ICustomTypeDescriptor.GetProperties> overload.
private PropertyDescriptorCollection MyGetPropertiesImpl(
Attribute[] attributes) {
PropertyDescriptorCollection props =
GetProperties(attributes);
if (ReadOnly) {
Type thisType = GetType();
ArrayList readOnlyProperties = new ArrayList();
foreach (PropertyDescriptor prop in props) {
readOnlyProperties.Add(
TypeDescriptor.CreateProperty(
thisType, prop,
new ReadOnlyAttribute(true))
);
}
props = new PropertyDescriptorCollection(
(PropertyDescriptor[])readOnlyProperties.ToArray(
typeof(PropertyDescriptor))
);
}
return props;
}
Applies to
ICustomTypeDescriptor.GetProperties(Attribute[])
Returns the properties for the property grid, using the specified attribute array as a filter.
virtual System::ComponentModel::PropertyDescriptorCollection ^ System.ComponentModel.ICustomTypeDescriptor.GetProperties(cli::array <Attribute ^> ^ attributes) = System::ComponentModel::ICustomTypeDescriptor::GetProperties;
System.ComponentModel.PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties (Attribute[] attributes);
Function GetProperties (attributes As Attribute()) As PropertyDescriptorCollection Implements ICustomTypeDescriptor.GetProperties
Parameters
Returns
An array of Attribute objects that represents the properties of the property grid that match the given set of attributes.
Implements
Examples
The following example duplicates the <xref:Microsoft.Web.Management.Client.PropertyGridObject.System.ComponentModel.ICustomTypeDescriptor.GetProperties%28System.Attribute%5B%5D%29> overload.
private PropertyDescriptorCollection MyGetPropertiesImpl(
Attribute[] attributes) {
PropertyDescriptorCollection props =
GetProperties(attributes);
if (ReadOnly) {
Type thisType = GetType();
ArrayList readOnlyProperties = new ArrayList();
foreach (PropertyDescriptor prop in props) {
readOnlyProperties.Add(
TypeDescriptor.CreateProperty(
thisType, prop,
new ReadOnlyAttribute(true))
);
}
props = new PropertyDescriptorCollection(
(PropertyDescriptor[])readOnlyProperties.ToArray(
typeof(PropertyDescriptor))
);
}
return props;
}