TypeDescriptor.GetClassName 方法    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回指定组件的类的名称。
重载
| GetClassName(Object) | 
						 使用默认类型描述符,返回指定组件的类的名称。  | 
        	
| GetClassName(Type) | 
						 返回指定类型的类的名称。  | 
        	
| GetClassName(Object, Boolean) | 
						 使用自定义类型描述符返回指定组件的类的名称。  | 
        	
GetClassName(Object)
- Source:
 - TypeDescriptor.cs
 
- Source:
 - TypeDescriptor.cs
 
- Source:
 - TypeDescriptor.cs
 
使用默认类型描述符,返回指定组件的类的名称。
public:
 static System::String ^ GetClassName(System::Object ^ component);
	public static string GetClassName (object component);
	public static string? GetClassName (object component);
	static member GetClassName : obj -> string
	Public Shared Function GetClassName (component As Object) As String
	参数
返回
一个包含指定组件的类的名称的 String。
例外
              component 为 null。
注解
通常,此方法返回参数类型的全 Type 名 component 。 例如,按钮的类名称为“System.Windows”。Forms。按钮”。 如果 component 实现 ICustomTypeDescriptor,它可以返回备用名称。
此方法等效于具有第二个参数的false重载GetClassName(Object, Boolean)方法。
另请参阅
- GetClassName()
 - GetComponentName
 - GetFullComponentName(Object)
 - CreateInstance(IServiceProvider, Type, Type[], Object[])
 - GetReflectionType
 
适用于
GetClassName(Type)
- Source:
 - TypeDescriptor.cs
 
- Source:
 - TypeDescriptor.cs
 
- Source:
 - TypeDescriptor.cs
 
返回指定类型的类的名称。
public:
 static System::String ^ GetClassName(Type ^ componentType);
	public static 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,其中包含指定组件类型的类的名称。
例外
              componentType 为 null。
注解
此方法使用指定类型的缓存自定义类型描述符来发现关联的类名。
另请参阅
- GetClassName()
 - GetComponentName
 - GetFullComponentName(Object)
 - CreateInstance(IServiceProvider, Type, Type[], Object[])
 - GetReflectionType
 
适用于
GetClassName(Object, Boolean)
- Source:
 - TypeDescriptor.cs
 
- Source:
 - TypeDescriptor.cs
 
- Source:
 - TypeDescriptor.cs
 
使用自定义类型描述符返回指定组件的类的名称。
public:
 static System::String ^ GetClassName(System::Object ^ component, bool noCustomTypeDesc);
	public static string GetClassName (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
	参数
- noCustomTypeDesc
 - Boolean
 
若不考虑自定义类型描述信息时,为 true;否则为 false。
返回
一个包含指定组件的类的名称的 String。
例外
              component 为 null。
              component 是一个跨进程进行远程处理的对象。
注解
通常,此方法返回参数类型的全 Type 名 component 。 例如,按钮的类名称为“System.Windows”。Forms。按钮”。 如果 参数 component 实现 ICustomTypeDescriptor,则可以返回备用名称。
另请参阅
- GetClassName()
 - ICustomTypeDescriptor
 - GetComponentName
 - GetFullComponentName(Object)
 - CreateInstance(IServiceProvider, Type, Type[], Object[])
 - GetReflectionType