Language

TypeDescriptor.GetComponentName メソッド

定義

指定したコンポーネントの名前を返します。

オーバーロード

名前 説明
GetComponentName(Object)

既定の型記述子を使用して、指定したコンポーネントの名前を返します。

GetComponentName(Object, Boolean)

カスタム型記述子を使用して、指定したコンポーネントの名前を返します。

GetComponentName(Object)

ソース:
TypeDescriptor.cs
ソース:
TypeDescriptor.cs
ソース:
TypeDescriptor.cs
ソース:
TypeDescriptor.cs
ソース:
TypeDescriptor.cs

既定の型記述子を使用して、指定したコンポーネントの名前を返します。

public:
 static System::String ^ GetComponentName(System::Object ^ component);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static string? GetComponentName(object component);
public static string GetComponentName(object component);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")>]
static member GetComponentName : obj -> string
static member GetComponentName : obj -> string
Public Shared Function GetComponentName (component As Object) As String

パラメーター

component
Object

クラス名を指定する Object 。

返品

指定したコンポーネントの名前を含む String 。コンポーネント名がない場合は null 。

属性

例外

component は nullです。

component は、プロセス間のリモート オブジェクトです。

注釈

通常、このメソッドはコンポーネントのサイトの名前 (存在する場合) を返します。 たとえば、ボタンのクラス名は "System.Windows。Forms.Button"。

このメソッドは、GetComponentName(Object, Boolean) の 2 番目のパラメーターを持つオーバーロードされたfalse メソッドと同じです。

このメソッドは、デザイン時にコンポーネントのインスタンスの名前を取得するために使用されます。

こちらもご覧ください

適用対象

GetComponentName(Object, Boolean)

ソース:
TypeDescriptor.cs
ソース:
TypeDescriptor.cs
ソース:
TypeDescriptor.cs
ソース:
TypeDescriptor.cs
ソース:
TypeDescriptor.cs

カスタム型記述子を使用して、指定したコンポーネントの名前を返します。

public:
 static System::String ^ GetComponentName(System::Object ^ component, bool noCustomTypeDesc);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static string? GetComponentName(object component, bool noCustomTypeDesc);
public static string GetComponentName(object component, bool noCustomTypeDesc);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")>]
static member GetComponentName : obj * bool -> string
static member GetComponentName : obj * bool -> string
Public Shared Function GetComponentName (component As Object, noCustomTypeDesc As Boolean) As String

パラメーター

component
Object

クラス名を指定する Object 。

noCustomTypeDesc
Boolean

true カスタム型の説明情報を考慮しない場合。それ以外の場合は false。

返品

指定したコンポーネントのクラスの名前。コンポーネント名がない場合は null 。

属性

例外

component は nullです。

component は、プロセス間のリモート オブジェクトです。

注釈

このメソッドは、デザイン時にコンポーネントのインスタンスの名前を取得するために使用されます。 通常、このメソッドはコンポーネントのサイトの名前 (存在する場合) を返します。 たとえば、ボタンのクラス名は "System.Windows。Forms.Button"。 コンポーネントが ICustomTypeDescriptor インターフェイスを実装している場合は、代替名を返すことができます。

こちらもご覧ください

適用対象