CodeTypeDeclaration イベント

名前 | 説明 | |
---|---|---|
![]() | PopulateBaseTypes | BaseTypes コレクションが最初にアクセスされたときに発生します。 |
![]() | PopulateMembers | Members コレクションが最初にアクセスされたときに発生します。 |

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

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

CodeTypeDeclaration を使用して、クラス、構造体、インターフェイス、または列挙体を宣言するコードを表すことができます。CodeTypeDeclaration を使用して、別の型の中に入れ子になった型を宣言できます。
BaseTypes プロパティは、宣言される型の 1 つ以上の基本型を指定します。Members プロパティは、型のメンバを格納します。これには、メソッド、フィールド、プロパティ、コメント、および他の型があります。TypeAttributes プロパティは、型宣言の TypeAttributes 値を示します。これはその型のカテゴリを示します。IsClass、IsStruct、IsEnum、および IsInterface の各メソッドは、それぞれ、その型がクラス型、構造体型、列挙体型、またはインターフェイス型かどうかを示します。
![]() |
---|
プログラミング言語によっては、参照型またはクラスの宣言しかサポートされないこともあります。言語固有の CodeDOM コード ジェネレータがインターフェイス、列挙体、または値型の宣言をサポートしているかどうかを調べるには、Supports メソッドを呼び出して該当する GeneratorSupport フラグを調べます。DeclareInterfaces はインターフェイスのサポートを示し、DeclareEnums は列挙体のサポートを示し、DeclareValueTypes は構造体などの値型のサポートを示します。 |
1 つの宣言内に完結するクラスまたは構造体の実装を作成することも、複数の宣言にわたって実装することもできます。IsPartial プロパティは、型宣言が完全か、部分的かを示します。部分的な型宣言がサポートされないコード ジェネレータもあるので、PartialTypes フラグを指定して Supports メソッドを呼び出し、このサポートをテストします。

CodeTypeDeclaration を使用して型を宣言する例を次に示します。
' Creates a new type declaration. Dim newType As New CodeTypeDeclaration("TestType") ' name parameter indicates the name of the type. ' Sets the member attributes for the type to private. newType.Attributes = MemberAttributes.Private ' Sets a base class which the type inherits from. newType.BaseTypes.Add("BaseType") ' A Visual Basic code generator produces the following source code for the preceeding example code: ' Class TestType ' Inherits BaseType ' End Class
// Creates a new type declaration. CodeTypeDeclaration newType = new CodeTypeDeclaration( // name parameter indicates the name of the type. "TestType"); // Sets the member attributes for the type to private. newType.Attributes = MemberAttributes.Private; // Sets a base class which the type inherits from. newType.BaseTypes.Add( "BaseType" ); // A C# code generator produces the following source code for the preceeding example code: // class TestType : BaseType // { // }
// Creates a new type declaration. // name parameter indicates the name of the type. CodeTypeDeclaration^ newType = gcnew CodeTypeDeclaration( "TestType" ); // Sets the member attributes for the type to private. newType->Attributes = MemberAttributes::Private; // Sets a base class which the type inherits from. newType->BaseTypes->Add( "BaseType" ); // A C# code generator produces the following source code for the preceeding example code: // class TestType : BaseType // { // }
// Creates a new type declaration. CodeTypeDeclaration newType = new CodeTypeDeclaration( // name parameter indicates the name of the type. "TestType"); // Sets the member attributes for the type to private. newType.set_Attributes(MemberAttributes.Private); // Sets a base class which the type inherits from. newType.get_BaseTypes().Add("BaseType"); // A VJ# code generator produces the following source code for the // preceeding example code: // class TestType extends BaseType // { // }

System.CodeDom.CodeObject
System.CodeDom.CodeTypeMember
System.CodeDom.CodeTypeDeclaration
System.CodeDom.CodeTypeDelegate


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeTypeDeclaration コンストラクタ ()
アセンブリ: 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeTypeDeclaration コンストラクタ

名前 | 説明 |
---|---|
CodeTypeDeclaration () | CodeTypeDeclaration クラスの新しいインスタンスを初期化します。 |
CodeTypeDeclaration (String) | 指定した名前を使用して、CodeTypeDeclaration クラスの新しいインスタンスを初期化します。 |

CodeTypeDeclaration コンストラクタ (String)
アセンブリ: 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeTypeDeclaration プロパティ

名前 | 説明 | |
---|---|---|
![]() | Attributes | メンバの属性を取得または設定します。 ( CodeTypeMember から継承されます。) |
![]() | BaseTypes | 型の基本型を取得します。 |
![]() | Comments | 型メンバのコメント コレクションを取得します。 ( CodeTypeMember から継承されます。) |
![]() | CustomAttributes | メンバのカスタム属性を取得または設定します。 ( CodeTypeMember から継承されます。) |
![]() | EndDirectives | メンバの終了ディレクティブを取得します。 ( CodeTypeMember から継承されます。) |
![]() | IsClass | 型がクラスまたは参照型かどうかを示す値を取得または設定します。 |
![]() | IsEnum | 型が列挙体かどうかを示す値を取得または設定します。 |
![]() | IsInterface | 型がインターフェイスかどうかを示す値を取得または設定します。 |
![]() | IsPartial | 型宣言が完全か部分的かを示す値を取得または設定します。 |
![]() | IsStruct | 型が値型 (構造体) かどうかを示す値を取得または設定します。 |
![]() | LinePragma | 型メンバのステートメントが発生する行を取得または設定します。 ( CodeTypeMember から継承されます。) |
![]() | Members | 表される型のクラス メンバのコレクションを取得します。 |
![]() | Name | メンバの名前を取得または設定します。 ( CodeTypeMember から継承されます。) |
![]() | StartDirectives | メンバの開始ディレクティブを取得します。 ( CodeTypeMember から継承されます。) |
![]() | TypeAttributes | 型の属性を取得または設定します。 |
![]() | TypeParameters | 型宣言の型パラメータを取得します。 |
![]() | UserData | 現在のオブジェクトのユーザー定義可能なデータを取得または設定します。 ( CodeObject から継承されます。) |

CodeTypeDeclaration メソッド

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

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

CodeTypeDeclaration メンバ
クラス、構造体、インターフェイス、または列挙体の型宣言を表します。
CodeTypeDeclaration データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Attributes | メンバの属性を取得または設定します。(CodeTypeMember から継承されます。) |
![]() | BaseTypes | 型の基本型を取得します。 |
![]() | Comments | 型メンバのコメント コレクションを取得します。(CodeTypeMember から継承されます。) |
![]() | CustomAttributes | メンバのカスタム属性を取得または設定します。(CodeTypeMember から継承されます。) |
![]() | EndDirectives | メンバの終了ディレクティブを取得します。(CodeTypeMember から継承されます。) |
![]() | IsClass | 型がクラスまたは参照型かどうかを示す値を取得または設定します。 |
![]() | IsEnum | 型が列挙体かどうかを示す値を取得または設定します。 |
![]() | IsInterface | 型がインターフェイスかどうかを示す値を取得または設定します。 |
![]() | IsPartial | 型宣言が完全か部分的かを示す値を取得または設定します。 |
![]() | IsStruct | 型が値型 (構造体) かどうかを示す値を取得または設定します。 |
![]() | LinePragma | 型メンバのステートメントが発生する行を取得または設定します。(CodeTypeMember から継承されます。) |
![]() | Members | 表される型のクラス メンバのコレクションを取得します。 |
![]() | Name | メンバの名前を取得または設定します。(CodeTypeMember から継承されます。) |
![]() | StartDirectives | メンバの開始ディレクティブを取得します。(CodeTypeMember から継承されます。) |
![]() | TypeAttributes | 型の属性を取得または設定します。 |
![]() | TypeParameters | 型宣言の型パラメータを取得します。 |
![]() | 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 から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | PopulateBaseTypes | BaseTypes コレクションが最初にアクセスされたときに発生します。 |
![]() | PopulateMembers | Members コレクションが最初にアクセスされたときに発生します。 |

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

- CodeTypeDeclarationのページへのリンク