CodeCommentStatement クラス

定義

1 つのコメントで構成されるステートメントを表します。

public ref class CodeCommentStatement : System::CodeDom::CodeStatement
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeCommentStatement : System.CodeDom.CodeStatement
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeCommentStatement = class
    inherit CodeStatement
Public Class CodeCommentStatement
Inherits CodeStatement
継承
CodeCommentStatement
属性

この例では、ソース コードで CodeCommentStatement を使用してコメントを表す方法を示します。

// 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.
     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

注釈

CodeCommentStatement は、1 行のコメント ステートメントを表すために使用できます。 CodeCommentStatement はステートメントであるため、ステートメント コレクションに挿入でき、独自の行に表示されます。 CodeCommentStatement は、 CodeNamespace のコメント コレクションまたは CodeTypeMemberから派生した任意のオブジェクトに追加することもできます。

コンストラクター

名前 説明
CodeCommentStatement()

CodeCommentStatement クラスの新しいインスタンスを初期化します。

CodeCommentStatement(CodeComment)

指定したコメントを使用して、 CodeCommentStatement クラスの新しいインスタンスを初期化します。

CodeCommentStatement(String, Boolean)

指定したテキストおよびドキュメント コメント フラグを使用して、 CodeCommentStatement クラスの新しいインスタンスを初期化します。

CodeCommentStatement(String)

指定したテキストを内容として使用して、 CodeCommentStatement クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
Comment

コメントの内容を取得または設定します。

EndDirectives

終了ディレクティブを含む CodeDirectiveCollection オブジェクトを取得します。

(継承元 CodeStatement)
LinePragma

コード ステートメントが発生する行を取得または設定します。

(継承元 CodeStatement)
StartDirectives

開始ディレクティブを含む CodeDirectiveCollection オブジェクトを取得します。

(継承元 CodeStatement)
UserData

現在のオブジェクトのユーザー定義可能なデータを取得します。

(継承元 CodeObject)

メソッド

名前 説明
Equals(Object)

指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象

こちらもご覧ください