Share via


CodeComment Sınıf

Tanım

Açıklamayı temsil eder.

public ref class CodeComment : System::CodeDom::CodeObject
public class CodeComment : System.CodeDom.CodeObject
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeComment : System.CodeDom.CodeObject
type CodeComment = class
    inherit CodeObject
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeComment = class
    inherit CodeObject
Public Class CodeComment
Inherits CodeObject
Devralma
CodeComment
Öznitelikler

Örnekler

Bu örnekte, kaynak kodunda açıklamayı temsil etmek için bir CodeComment kullanımı gösterilmektedir.

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

Açıklamalar

CodeComment tek bir satır açıklamasını temsil etmek için kullanılabilir.

bir CodeCommentStatement içerebilir CodeComment ve deyimi olarak kabul edilmesini ve bir deyimler koleksiyonu içinde kod olarak oluşturulmasını sağlar. Çok satırlı açıklamalar birden çok CodeCommentStatement nesneyle temsil edilebilir.

Bir CodeDOM grafiğine kaynak koda oluşturulabilecek bir açıklama eklemek için, öğesine ekleyin CodeCommentCodeCommentStatementve bunu veya deyimleri koleksiyonuna CodeMemberMethod veya öğesinden CodeTypeMembertüretilen herhangi bir CodeNamespace nesnenin açıklama koleksiyonuna ekleyin.

Oluşturucular

CodeComment()

CodeComment sınıfının yeni bir örneğini başlatır.

CodeComment(String)

Belirtilen metin içerik olarak sınıfın CodeComment yeni bir örneğini başlatır.

CodeComment(String, Boolean)

Belirtilen metin ve belge açıklama bayrağını CodeComment kullanarak sınıfının yeni bir örneğini başlatır.

Özellikler

DocComment

Açıklamanın belge açıklaması olup olmadığını belirten bir değer alır veya ayarlar.

Text

Açıklama metnini alır veya ayarlar.

UserData

Geçerli nesne için kullanıcı tarafından tanımlanabilir verileri alır.

(Devralındığı yer: CodeObject)

Yöntemler

Equals(Object)

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetHashCode()

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetType()

Type Geçerli örneğini alır.

(Devralındığı yer: Object)
MemberwiseClone()

Geçerli Objectöğesinin sığ bir kopyasını oluşturur.

(Devralındığı yer: Object)
ToString()

Geçerli nesneyi temsil eden dizeyi döndürür.

(Devralındığı yer: Object)

Şunlara uygulanır

Ayrıca bkz.