TypeDescriptor.GetComponentName Метод
Определение
Возвращает имя указанного компонента.Returns the name of the specified component.
Перегрузки
GetComponentName(Object) |
Возвращает имя указанного компонента, используя дескриптор типа по умолчанию.Returns the name of the specified component using the default type descriptor. |
GetComponentName(Object, Boolean) |
Возвращает имя указанного компонента, используя дескриптор пользовательского типа.Returns the name of the specified component using a custom type descriptor. |
GetComponentName(Object)
Возвращает имя указанного компонента, используя дескриптор типа по умолчанию.Returns the name of the specified component using the default type descriptor.
public:
static System::String ^ GetComponentName(System::Object ^ component);
public static string GetComponentName (object component);
static member GetComponentName : obj -> string
Public Shared Function GetComponentName (component As Object) As String
Параметры
- component
- Object
Объект Object, для которого требуется получить имя класса.The Object for which you want the class name.
Возвращаемое значение
Строка String, содержащая имя заданного компонента, или null
, если имя компонента отсутствует.A String containing the name of the specified component, or null
if there is no component name.
Исключения
component
имеет значение null
.component
is null
.
Параметр component
является межпроцессным удаленным объектом.component
is a cross-process remoted object.
Комментарии
Как правило, этот метод возвращает имя для сайта компонента, если он существует.Typically, this method returns the name for the site of the component, if one exists. Например, имя класса для кнопки — System. Windows. Forms. Button.For example, the class name for a button is "System.Windows.Forms.Button".
Этот метод эквивалентен перегруженному GetComponentName(Object, Boolean) методу со вторым параметром false
.This method is equivalent to the overloaded GetComponentName(Object, Boolean) method with a second parameter of false
.
Этот метод используется во время разработки для получения имени экземпляра компонента.This method is used at design time to retrieve the name of an instance of a component.
См. также раздел
- GetComponentName()
- GetClassName
- GetFullComponentName(Object)
- CreateInstance(IServiceProvider, Type, Type[], Object[])
- GetReflectionType
Применяется к
GetComponentName(Object, Boolean)
Возвращает имя указанного компонента, используя дескриптор пользовательского типа.Returns the name of the specified component using a custom type descriptor.
public:
static System::String ^ GetComponentName(System::Object ^ component, bool noCustomTypeDesc);
public static string GetComponentName (object component, bool noCustomTypeDesc);
static member GetComponentName : obj * bool -> string
Public Shared Function GetComponentName (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
.
Возвращаемое значение
Имя класса для заданного компонента или null
, если имя компонента отсутствует.The name of the class for the specified component, or null
if there is no component name.
Исключения
component
имеет значение null
.component
is null
.
Параметр component
является межпроцессным удаленным объектом.component
is a cross-process remoted object.
Комментарии
Этот метод используется во время разработки для получения имени экземпляра компонента.This method is used at design time to retrieve the name of an instance of a component. Как правило, этот метод возвращает имя для сайта компонента, если он существует.Typically, this method returns the name for the site of the component, if one exists. Например, имя класса для кнопки — System. Windows. Forms. Button.For example, the class name for a button is "System.Windows.Forms.Button". Если компонент реализует ICustomTypeDescriptor интерфейс, он может вернуть альтернативное имя.If the component implements the ICustomTypeDescriptor interface, it can return an alternate name.
См. также раздел
- GetComponentName()
- ICustomTypeDescriptor
- GetClassName
- GetFullComponentName(Object)
- CreateInstance(IServiceProvider, Type, Type[], Object[])
- GetReflectionType