CodeCommentStatement Třída

Definice

Představuje příkaz skládající se z jednoho komentáře.

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
Dědičnost
CodeCommentStatement
Atributy

Příklady

Tento příklad ukazuje použití CodeCommentStatement k reprezentaci komentáře ve zdrojovém kódu.

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

Poznámky

CodeCommentStatement lze použít k reprezentaci jednořádkového příkazu komentáře. CodeCommentStatement je příkaz, takže jej lze vložit do kolekce příkazů a zobrazí se na vlastním řádku. CodeCommentStatement lze také přidat do kolekce komentářů nebo jakéhokoli objektu CodeNamespace , který je odvozen z CodeTypeMember.

Konstruktory

Name Description
CodeCommentStatement()

Inicializuje novou instanci CodeCommentStatement třídy.

CodeCommentStatement(CodeComment)

Inicializuje novou instanci CodeCommentStatement třídy pomocí zadaného komentáře.

CodeCommentStatement(String, Boolean)

Inicializuje novou instanci CodeCommentStatement třídy pomocí zadaného textu a příznaku komentáře dokumentace.

CodeCommentStatement(String)

Inicializuje novou instanci CodeCommentStatement třídy pomocí zadaného textu jako obsahu.

Vlastnosti

Name Description
Comment

Získá nebo nastaví obsah komentáře.

EndDirectives

CodeDirectiveCollection Získá objekt, který obsahuje koncové direktivy.

(Zděděno od CodeStatement)
LinePragma

Získá nebo nastaví řádek, na kterém dojde k příkazu kódu.

(Zděděno od CodeStatement)
StartDirectives

CodeDirectiveCollection Získá objekt, který obsahuje direktivy start.

(Zděděno od CodeStatement)
UserData

Získá uživatelem definovatelná data pro aktuální objekt.

(Zděděno od CodeObject)

Metody

Name Description
Equals(Object)

Určuje, zda je zadaný objekt roven aktuálnímu objektu.

(Zděděno od Object)
GetHashCode()

Slouží jako výchozí funkce hash.

(Zděděno od Object)
GetType()

Získá Type aktuální instance.

(Zděděno od Object)
MemberwiseClone()

Vytvoří mělkou kopii aktuálního Object.

(Zděděno od Object)
ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)

Platí pro

Viz také