Bewerken

Share via


TypeDescriptor.GetDefaultProperty Method

Definition

Returns the default property for a component.

Overloads

GetDefaultProperty(Object, Boolean)

Returns the default property for the specified component with a custom type descriptor.

GetDefaultProperty(Object)

Returns the default property for the specified component.

GetDefaultProperty(Type)

Returns the default property for the specified type of component.

GetDefaultProperty(Object, Boolean)

Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs

Returns the default property for the specified component with a custom type descriptor.

public:
 static System::ComponentModel::PropertyDescriptor ^ GetDefaultProperty(System::Object ^ component, bool noCustomTypeDesc);
public static System.ComponentModel.PropertyDescriptor GetDefaultProperty (object component, bool noCustomTypeDesc);
public static System.ComponentModel.PropertyDescriptor? GetDefaultProperty (object component, bool noCustomTypeDesc);
static member GetDefaultProperty : obj * bool -> System.ComponentModel.PropertyDescriptor
Public Shared Function GetDefaultProperty (component As Object, noCustomTypeDesc As Boolean) As PropertyDescriptor

Parameters

component
Object

The component to get the default property for.

noCustomTypeDesc
Boolean

true to not consider custom type description information; otherwise, false.

Returns

A PropertyDescriptor with the default property, or null if there are no properties.

Exceptions

component is a cross-process remoted object.

Remarks

If the component parameter is null, this method returns null.

See also

Applies to

GetDefaultProperty(Object)

Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs

Returns the default property for the specified component.

public:
 static System::ComponentModel::PropertyDescriptor ^ GetDefaultProperty(System::Object ^ component);
public static System.ComponentModel.PropertyDescriptor GetDefaultProperty (object component);
public static System.ComponentModel.PropertyDescriptor? GetDefaultProperty (object component);
static member GetDefaultProperty : obj -> System.ComponentModel.PropertyDescriptor
Public Shared Function GetDefaultProperty (component As Object) As PropertyDescriptor

Parameters

component
Object

The component to get the default property for.

Returns

A PropertyDescriptor with the default property, or null if there are no properties.

Exceptions

component is a cross-process remoted object.

Remarks

If the component parameter is null, this method returns null.

See also

Applies to

GetDefaultProperty(Type)

Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs

Returns the default property for the specified type of component.

public:
 static System::ComponentModel::PropertyDescriptor ^ GetDefaultProperty(Type ^ componentType);
public static System.ComponentModel.PropertyDescriptor GetDefaultProperty (Type componentType);
public static System.ComponentModel.PropertyDescriptor? GetDefaultProperty (Type componentType);
static member GetDefaultProperty : Type -> System.ComponentModel.PropertyDescriptor
Public Shared Function GetDefaultProperty (componentType As Type) As PropertyDescriptor

Parameters

componentType
Type

A Type that represents the class to get the property for.

Returns

A PropertyDescriptor with the default property, or null if there are no properties.

Remarks

Call this version of this method only when you do not have an instance of the object.

If the componentType parameter is null, this method returns null.

See also

Applies to