TypeDescriptor.GetClassName Method
Definition
Returns the name of the class for the specified component.
Overloads
GetClassName(Object) |
Returns the name of the class for the specified component using the default type descriptor. |
GetClassName(Type) |
Returns the name of the class for the specified type. |
GetClassName(Object, Boolean) |
Returns the name of the class for the specified component using a custom type descriptor. |
GetClassName(Object)
Returns the name of the class for the specified component using the default type descriptor.
public:
static System::String ^ GetClassName(System::Object ^ component);
public static string GetClassName (object component);
static member GetClassName : obj -> string
Public Shared Function GetClassName (component As Object) As String
Parameters
Returns
A String containing the name of the class for the specified component.
Exceptions
component
is null
.
Remarks
Typically, this method returns the full Type name for the component
parameter type. For example, the class name for a button is "System.Windows.Forms.Button". If component
implements ICustomTypeDescriptor, it can return an alternate name.
This method is equivalent to the overloaded GetClassName(Object, Boolean) method with a second parameter of false
.
See also
- GetClassName()
- GetComponentName
- GetFullComponentName(Object)
- CreateInstance(IServiceProvider, Type, Type[], Object[])
- GetReflectionType
Applies to
GetClassName(Type)
Returns the name of the class for the specified type.
public:
static System::String ^ GetClassName(Type ^ componentType);
public static string GetClassName (Type componentType);
static member GetClassName : Type -> string
Public Shared Function GetClassName (componentType As Type) As String
Parameters
Returns
A String containing the name of the class for the specified component type.
Exceptions
componentType
is null
.
Remarks
This method uses the cached custom type descriptor for the specified type to discover the associated class name.
See also
- GetClassName()
- GetComponentName
- GetFullComponentName(Object)
- CreateInstance(IServiceProvider, Type, Type[], Object[])
- GetReflectionType
Applies to
GetClassName(Object, Boolean)
Returns the name of the class for the specified component using a custom type descriptor.
public:
static System::String ^ GetClassName(System::Object ^ component, bool noCustomTypeDesc);
public static string GetClassName (object component, bool noCustomTypeDesc);
static member GetClassName : obj * bool -> string
Public Shared Function GetClassName (component As Object, noCustomTypeDesc As Boolean) As String
Parameters
- noCustomTypeDesc
- Boolean
true
to consider custom type description information; otherwise, false
.
Returns
A String containing the name of the class for the specified component.
Exceptions
component
is null
.
component
is a cross-process remoted object.
Remarks
Typically, this method returns the full Type name for the component
parameter type. For example, the class name for a button is "System.Windows.Forms.Button". If the component
parameter implements ICustomTypeDescriptor, it can return an alternate name.
See also
- GetClassName()
- ICustomTypeDescriptor
- GetComponentName
- GetFullComponentName(Object)
- CreateInstance(IServiceProvider, Type, Type[], Object[])
- GetReflectionType