CodeTypeReference クラス
アセンブリ: System (system.dll 内)

<SerializableAttribute> _ <ComVisibleAttribute(True)> _ <ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _ Public Class CodeTypeReference Inherits CodeObject
[SerializableAttribute] [ComVisibleAttribute(true)] [ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] public class CodeTypeReference : CodeObject
[SerializableAttribute] [ComVisibleAttribute(true)] [ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] public ref class CodeTypeReference : public CodeObject

CodeTypeReference オブジェクトは、CodeDOM オブジェクトの型を表すために使用されます。CodeDOM の型に Type プロパティが設定されている場合、そのプロパティは CodeTypeReference 型です。たとえば、CodeMemberField.Type プロパティは、フィールドのデータ型を表す CodeTypeReference です。
CodeTypeReference は、Type オブジェクトまたは文字列で初期化できます。一般に、この初期化には Type を使用することをお勧めしますが、使用できない場合もあります。このクラスのインスタンスを文字列で初期化する場合には、すべての言語で名前空間のインポートがサポートされているわけではないため、常に完全限定型を使用することを強くお勧めします。たとえば、単なる "Console"ではなく、"System.Console" を使用してください。配列型は、配列の型オブジェクト内で渡すか、ランクをパラメータとして受け入れるコンストラクタの 1 つを使用することによって、指定できます。
BaseType プロパティは、参照する型の名前を指定します。配列型への参照の場合は、ArrayElementType プロパティが配列の要素の型を示し、ArrayRank プロパティが配列の次元の数を示します。

CodeTypeReference を使用して型への参照を表す例を次に示します。
' Creates a reference to the System.DateTime type. Dim typeRef1 As New CodeTypeReference("System.DateTime") ' Creates a typeof expression for the specified type reference. Dim typeof1 As New CodeTypeOfExpression(typeRef1) ' A Visual Basic code generator produces the following source code for the preceeding example code: ' GetType(System.DateTime)
// Creates a reference to the System.DateTime type. CodeTypeReference typeRef1 = new CodeTypeReference("System.DateTime"); // Creates a typeof expression for the specified type reference. CodeTypeOfExpression typeof1 = new CodeTypeOfExpression(typeRef1); // A C# code generator produces the following source code for the preceeding example code: // typeof(System.DateTime);
// Creates a reference to the System.DateTime type. CodeTypeReference^ typeRef1 = gcnew CodeTypeReference( "System.DateTime" ); // Creates a typeof expression for the specified type reference. CodeTypeOfExpression^ typeof1 = gcnew CodeTypeOfExpression( typeRef1 ); // A C# code generator produces the following source code for the preceeding example code: // typeof(System.DateTime);
// Creates a reference to the System.DateTime type. CodeTypeReference typeRef1 = new CodeTypeReference("System.DateTime"); // Creates a typeof expression for the specified type reference. CodeTypeOfExpression typeof1 = new CodeTypeOfExpression(typeRef1); // A VJ# code generator produces the following source code for the // preceeding example code: // System.DateTime.class.ToType();

System.CodeDom.CodeObject
System.CodeDom.CodeTypeReference


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeTypeReference コンストラクタ ()
アセンブリ: System (system.dll 内)



Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeTypeReference コンストラクタ (CodeTypeReference, Int32)
アセンブリ: System (system.dll 内)

Dim arrayType As CodeTypeReference Dim rank As Integer Dim instance As New CodeTypeReference(arrayType, rank)
- arrayType
配列の型を示す CodeTypeReference。


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeTypeReference コンストラクタ (Type)
アセンブリ: System (system.dll 内)


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeTypeReference コンストラクタ (String, CodeTypeReference[])
アセンブリ: System (system.dll 内)

Dim typeName As String Dim typeArguments As CodeTypeReference() Dim instance As New CodeTypeReference(typeName, typeArguments)
- typeArguments
CodeTypeReference 値の配列。

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeTypeReference コンストラクタ (Type, CodeTypeReferenceOptions)
アセンブリ: System (system.dll 内)

Dim type As Type Dim codeTypeReferenceOption As CodeTypeReferenceOptions Dim instance As New CodeTypeReference(type, codeTypeReferenceOption)
public function CodeTypeReference ( type : Type, codeTypeReferenceOption : CodeTypeReferenceOptions )

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeTypeReference コンストラクタ (String)
アセンブリ: System (system.dll 内)


typeName パラメータでジェネリック型を参照する場合、ジェネリック型の構文規則に準拠する必要があります。たとえば、Dictionary の typeName の値は、System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Generic.List`1[[System.Int32]]]] です。型をパラメータとして受け入れる CodeTypeReference(Type) コンストラクタを代わりに使用することを検討してください。

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeTypeReference コンストラクタ (CodeTypeParameter)
アセンブリ: System (system.dll 内)

Public Sub New ( _ typeParameter As CodeTypeParameter _ )
Dim typeParameter As CodeTypeParameter Dim instance As New CodeTypeReference(typeParameter)
public CodeTypeReference ( CodeTypeParameter typeParameter )
public: CodeTypeReference ( CodeTypeParameter^ typeParameter )
public CodeTypeReference ( CodeTypeParameter typeParameter )
public function CodeTypeReference ( typeParameter : CodeTypeParameter )
- typeParameter
型パラメータの型を表す CodeTypeParameter。

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeTypeReference コンストラクタ (String, Int32)
アセンブリ: System (system.dll 内)


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeTypeReference コンストラクタ (String, CodeTypeReferenceOptions)
アセンブリ: System (system.dll 内)

Dim typeName As String Dim codeTypeReferenceOption As CodeTypeReferenceOptions Dim instance As New CodeTypeReference(typeName, codeTypeReferenceOption)
public function CodeTypeReference ( typeName : String, codeTypeReferenceOption : CodeTypeReferenceOptions )

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeTypeReference コンストラクタ

名前 | 説明 |
---|---|
CodeTypeReference () | CodeTypeReference クラスの新しいインスタンスを初期化します。 |
CodeTypeReference (CodeTypeParameter) | コード型パラメータを指定して、CodeTypeReference クラスの新しいインスタンスを初期化します。 |
CodeTypeReference (String) | 型名を指定して、CodeTypeReference クラスの新しいインスタンスを初期化します。 |
CodeTypeReference (Type) | 型を指定して、CodeTypeReference クラスの新しいインスタンスを初期化します。 |
CodeTypeReference (CodeTypeReference, Int32) | 配列の型とランクを指定して、CodeTypeReference クラスの新しいインスタンスを初期化します。 |
CodeTypeReference (String, CodeTypeReference[]) | 型名と型引数を指定して、CodeTypeReference クラスの新しいインスタンスを初期化します。 |
CodeTypeReference (String, CodeTypeReferenceOptions) | 型名とコード型参照オプションを指定して、CodeTypeReference クラスの新しいインスタンスを初期化します。 |
CodeTypeReference (String, Int32) | 配列の型名とランクを指定して、CodeTypeReference クラスの新しいインスタンスを初期化します。 |
CodeTypeReference (Type, CodeTypeReferenceOptions) | 型とコード型参照を指定して、CodeTypeReference クラスの新しいインスタンスを初期化します。 |

CodeTypeReference プロパティ

名前 | 説明 | |
---|---|---|
![]() | ArrayElementType | 配列内の要素の型を取得または設定します。 |
![]() | ArrayRank | 配列の配列ランクを取得または設定します。 |
![]() | BaseType | 参照される型の名前を取得または設定します。 |
![]() | Options | コード型参照オプションを取得または設定します。 |
![]() | TypeArguments | 現在のジェネリック型参照の型引数を取得します。 |
![]() | UserData | 現在のオブジェクトのユーザー定義可能なデータを取得または設定します。 ( CodeObject から継承されます。) |

CodeTypeReference メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

CodeTypeReference メンバ
CodeTypeReference データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | ArrayElementType | 配列内の要素の型を取得または設定します。 |
![]() | ArrayRank | 配列の配列ランクを取得または設定します。 |
![]() | BaseType | 参照される型の名前を取得または設定します。 |
![]() | Options | コード型参照オプションを取得または設定します。 |
![]() | TypeArguments | 現在のジェネリック型参照の型引数を取得します。 |
![]() | UserData | 現在のオブジェクトのユーザー定義可能なデータを取得または設定します。(CodeObject から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

Weblioに収録されているすべての辞書からCodeTypeReferenceを検索する場合は、下記のリンクをクリックしてください。

- CodeTypeReferenceのページへのリンク