CodeCommentStatement Osztály

Definíció

Egyetlen megjegyzésből álló utasítást jelöl.

public ref class CodeCommentStatement : System::CodeDom::CodeStatement
public 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
type CodeCommentStatement = class
    inherit 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
Öröklődés
CodeCommentStatement
Attribútumok

Példák

Ez a példa azt mutatja be, hogy egy CodeCommentStatement megjegyzést használ a forráskódban.

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

Megjegyzések

CodeCommentStatement egysoros megjegyzésutasítások megjelenítésére használható. CodeCommentStatement egy utasítás, így beszúrható egy utasításgyűjteménybe, és a saját sorában jelenik meg. CodeCommentStatement A megjegyzések gyűjteményéhez CodeNamespace vagy bármely olyan objektumhoz is hozzáadható, amely a következőből CodeTypeMemberszármazik: .

Konstruktorok

Name Description
CodeCommentStatement()

Inicializálja a CodeCommentStatement osztály új példányát.

CodeCommentStatement(CodeComment)

Inicializálja az osztály új példányát a CodeCommentStatement megadott megjegyzés használatával.

CodeCommentStatement(String, Boolean)

Inicializálja az osztály új példányát a CodeCommentStatement megadott szöveg- és dokumentáció-megjegyzésjelölővel.

CodeCommentStatement(String)

Inicializálja az osztály új példányát a CodeCommentStatement megadott szöveg tartalomként való használatával.

Tulajdonságok

Name Description
Comment

Lekéri vagy beállítja a megjegyzés tartalmát.

EndDirectives

Lekéri a CodeDirectiveCollection végfelhasználói irányelveket tartalmazó objektumot.

(Öröklődés forrása CodeStatement)
LinePragma

Lekéri vagy beállítja azt a sort, amelyen a kódutasítás történik.

(Öröklődés forrása CodeStatement)
StartDirectives

Lekéri a CodeDirectiveCollection kezdő irányelveket tartalmazó objektumot.

(Öröklődés forrása CodeStatement)
UserData

Lekéri az aktuális objektum felhasználó által definiálható adatait.

(Öröklődés forrása CodeObject)

Metódusok

Name Description
Equals(Object)

Meghatározza, hogy a megadott objektum egyenlő-e az aktuális objektummal.

(Öröklődés forrása Object)
GetHashCode()

Ez az alapértelmezett kivonatoló függvény.

(Öröklődés forrása Object)
GetType()

Lekéri az Type aktuális példányt.

(Öröklődés forrása Object)
MemberwiseClone()

Az aktuális Objectpéldány sekély másolatát hozza létre.

(Öröklődés forrása Object)
ToString()

Az aktuális objektumot jelképező sztringet ad vissza.

(Öröklődés forrása Object)

A következőre érvényes:

Lásd még