TypeDescriptor.GetClassName Метод
Определение
Возвращает имя класса для указанного компонента.Returns the name of the class for the specified component.
Перегрузки
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
Параметры
- component
- Object
Объект Object, для которого требуется получить имя класса.The Object for which you want the class name.
Возвращаемое значение
Объект String, содержащий имя класса для заданного компонента.A String containing the name of the class for the specified component.
Исключения
component
имеет значение null
.component
is null
.
Комментарии
Как правило, этот метод возвращает полное Type имя для component
типа параметра.Typically, this method returns the full Type name for the component
parameter type. Например, имя класса для кнопки — System. Windows. Forms. Button.For example, the class name for a button is "System.Windows.Forms.Button". Если component
реализует ICustomTypeDescriptor , он может возвращать альтернативное имя.If component
implements ICustomTypeDescriptor, it can return an alternate name.
Этот метод эквивалентен перегруженному GetClassName(Object, Boolean) методу со вторым параметром false
.This method is equivalent to the overloaded GetClassName(Object, Boolean) method with a second parameter of false
.
См. также раздел
- GetClassName()
- GetComponentName
- GetFullComponentName(Object)
- CreateInstance(IServiceProvider, Type, Type[], Object[])
- GetReflectionType
Применяется к
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
Параметры
Возвращаемое значение
Объект String, содержащий имя класса для заданного типа.A String containing the name of the class for the specified component type.
Исключения
componentType
имеет значение null
.componentType
is null
.
Комментарии
Этот метод использует кэшированный пользовательский дескриптор типа для указанного типа, чтобы обнаружить имя связанного класса.This method uses the cached custom type descriptor for the specified type to discover the associated class name.
См. также раздел
- GetClassName()
- GetComponentName
- GetFullComponentName(Object)
- CreateInstance(IServiceProvider, Type, Type[], Object[])
- GetReflectionType
Применяется к
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
Параметры
- component
- Object
Объект Object, для которого требуется получить имя класса.The Object for which you want the class name.
- noCustomTypeDesc
- Boolean
Значение true
для учета настраиваемых сведений описания типа; в противном случае — значение false
.true
to consider custom type description information; otherwise, false
.
Возвращаемое значение
Объект String, содержащий имя класса для заданного компонента.A String containing the name of the class for the specified component.
Исключения
component
имеет значение null
.component
is null
.
Параметр component
является межпроцессным удаленным объектом.component
is a cross-process remoted object.
Комментарии
Как правило, этот метод возвращает полное Type имя для component
типа параметра.Typically, this method returns the full Type name for the component
parameter type. Например, имя класса для кнопки — System. Windows. Forms. Button.For example, the class name for a button is "System.Windows.Forms.Button". Если component
параметр реализует ICustomTypeDescriptor , он может возвращать альтернативное имя.If the component
parameter implements ICustomTypeDescriptor, it can return an alternate name.
См. также раздел
- GetClassName()
- ICustomTypeDescriptor
- GetComponentName
- GetFullComponentName(Object)
- CreateInstance(IServiceProvider, Type, Type[], Object[])
- GetReflectionType