CodeCommentStatement Klasa
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Reprezentuje instrukcję składającą się z pojedynczego komentarza.
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
- Dziedziczenie
- Atrybuty
W tym przykładzie pokazano użycie elementu do CodeCommentStatement reprezentowania komentarza w kodzie źródłowym.
// 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
CodeCommentStatement może służyć do reprezentowania instrukcji komentarza jednowierszowego. CodeCommentStatement jest instrukcją , więc można ją wstawić do kolekcji instrukcji i pojawi się we własnym wierszu. CodeCommentStatement można również dodać do kolekcji komentarzy obiektu lub dowolnego obiektu pochodzącego CodeNamespace z klasy CodeTypeMember.
Code |
Inicjuje nowe wystąpienie klasy CodeCommentStatement. |
Code |
Inicjuje CodeCommentStatement nowe wystąpienie klasy przy użyciu określonego komentarza. |
Code |
Inicjuje CodeCommentStatement nowe wystąpienie klasy przy użyciu określonego tekstu jako zawartości. |
Code |
Inicjuje CodeCommentStatement nowe wystąpienie klasy przy użyciu określonego tekstu i flagi komentarza dokumentacji. |
Comment |
Pobiera lub ustawia zawartość komentarza. |
End |
CodeDirectiveCollection Pobiera obiekt zawierający dyrektywy końcowe. (Odziedziczone po CodeStatement) |
Line |
Pobiera lub ustawia wiersz, w którym występuje instrukcja kodu. (Odziedziczone po CodeStatement) |
Start |
CodeDirectiveCollection Pobiera obiekt zawierający dyrektywy startowe. (Odziedziczone po CodeStatement) |
User |
Pobiera dane zdefiniowane przez użytkownika dla bieżącego obiektu. (Odziedziczone po CodeObject) |
Equals(Object) |
Określa, czy dany obiekt jest taki sam, jak bieżący obiekt. (Odziedziczone po Object) |
Get |
Służy jako domyślna funkcja skrótu. (Odziedziczone po Object) |
Get |
Type Pobiera wartość bieżącego wystąpienia. (Odziedziczone po Object) |
Memberwise |
Tworzy płytkią kopię bieżącego Objectelementu . (Odziedziczone po Object) |
To |
Zwraca ciąg reprezentujący bieżący obiekt. (Odziedziczone po Object) |
Produkt | Wersje |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
Opinia o produkcie .NET
.NET to projekt typu open source. Wybierz link, aby przekazać opinię: