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

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

CodeComment を使用して、単一行のコメントを表すことができます。
CodeCommentStatement は CodeComment を格納でき、それがステートメントとして扱われ、ステートメントのコレクション内のコードとして生成されるようにします。複数行のコメントは、複数の CodeCommentStatement オブジェクトを使用して表すことができます。
ソース コードを生成できる CodeDOM グラフにコメントを含めるには、CodeComment を CodeCommentStatement に追加し、それを CodeMemberMethod のステートメント コレクション、CodeNamespace のコメント コレクション、または CodeTypeMember から派生する任意のオブジェクトのコメント コレクションに追加します。

CodeComment を使用してソース コード内のコメントを表す例を次に示します。
' Create a CodeComment with some example comment text. Dim comment As New CodeComment( _ "This comment was generated from a System.CodeDom.CodeComment", _ False) ' Whether the comment is a documentation comment. ' Create a CodeCommentStatement that contains the comment, in order ' to add the comment to a CodeTypeDeclaration Members collection. Dim commentStatement As New CodeCommentStatement(comment) ' A Visual Basic code generator produces the following source code for the preceeding example code: ' 'This comment was generated from a System.CodeDom.CodeComment
// Create a CodeComment with some example comment text. CodeComment comment = new CodeComment( // The text of the comment. "This comment was generated from a System.CodeDom.CodeComment", // Whether the comment is a comment intended for documentation purposes. false ); // Create a CodeCommentStatement that contains the comment, in order // to add the comment to a CodeTypeDeclaration Members collection. CodeCommentStatement commentStatement = new CodeCommentStatement( comment ); // A C# code generator produces the following source code for the preceeding example code: // // This comment was generated from a System.CodeDom.CodeComment
// Create a CodeComment with some example comment text. // The text of the comment. // Whether the comment is a comment intended for documentation purposes. CodeComment^ comment = gcnew CodeComment( "This comment was generated from a System.CodeDom.CodeComment",false ); // Create a CodeCommentStatement that contains the comment, in order // to add the comment to a CodeTypeDeclaration Members collection. CodeCommentStatement^ commentStatement = gcnew CodeCommentStatement( comment ); // A C# code generator produces the following source code for the preceeding example code: // // This comment was generated from a System.CodeDom.CodeComment
// Create a CodeComment with some example comment text. CodeComment comment = new CodeComment("This comment was generated " + "from a System.CodeDom.CodeComment", false); // The text of the comment. // Whether the comment is a comment intended for documentation purposes. // Create a CodeCommentStatement that contains the comment, in order // to add the comment to a CodeTypeDeclaration Members collection. CodeCommentStatement commentStatement = new CodeCommentStatement(comment); // A VJ# code generator produces the following source code for the // preceeding example code: // This comment was generated from a System.CodeDom.CodeComment

System.CodeDom.CodeObject
System.CodeDom.CodeComment


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


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


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


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


CodeComment コンストラクタ

名前 | 説明 |
---|---|
CodeComment () | CodeComment クラスの新しいインスタンスを初期化します。 |
CodeComment (String) | 内容としてテキストを指定して、CodeComment クラスの新しいインスタンスを初期化します。 |
CodeComment (String, Boolean) | テキストとドキュメント コメント フラグを指定して、CodeComment クラスの新しいインスタンスを初期化します。 |

CodeComment プロパティ

名前 | 説明 | |
---|---|---|
![]() | DocComment | コメントがドキュメント コメントかどうかを示す値を取得または設定します。 |
![]() | Text | コメントのテキストを取得または設定します。 |
![]() | UserData | 現在のオブジェクトのユーザー定義可能なデータを取得または設定します。 ( CodeObject から継承されます。) |

CodeComment メソッド

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

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

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


名前 | 説明 | |
---|---|---|
![]() | DocComment | コメントがドキュメント コメントかどうかを示す値を取得または設定します。 |
![]() | Text | コメントのテキストを取得または設定します。 |
![]() | 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 から継承されます。) |

- CodeCommentのページへのリンク