XComment 생성자

정의

XComment 클래스의 새 인스턴스를 초기화합니다.

오버로드

XComment(String)

지정된 문자열 콘텐츠를 사용하여 XComment 클래스의 새 인스턴스를 초기화합니다.

XComment(XComment)

기존 주석 노드를 사용하여 XComment 클래스의 새 인스턴스를 초기화합니다.

XComment(String)

지정된 문자열 콘텐츠를 사용하여 XComment 클래스의 새 인스턴스를 초기화합니다.

public:
 XComment(System::String ^ value);
public XComment (string value);
new System.Xml.Linq.XComment : string -> System.Xml.Linq.XComment
Public Sub New (value As String)

매개 변수

value
String

XComment 개체의 콘텐츠가 들어 있는 문자열입니다.

예외

value 매개 변수가 null인 경우

예제

다음 예제에서는 주석을 자식 노드로 포함하는 요소를 만듭니다.

XElement root = new XElement("Root",  
    new XComment("This is a comment")  
);  
Console.WriteLine(root);  
Dim root As XElement = <Root>  
                           <!--This is a comment-->  
                       </Root>  
Console.WriteLine(root)  

이 예제는 다음과 같은 출력을 생성합니다.

<Root>  
  <!--This is a comment-->  
</Root>  

추가 정보

적용 대상

XComment(XComment)

기존 주석 노드를 사용하여 XComment 클래스의 새 인스턴스를 초기화합니다.

public:
 XComment(System::Xml::Linq::XComment ^ other);
public XComment (System.Xml.Linq.XComment other);
new System.Xml.Linq.XComment : System.Xml.Linq.XComment -> System.Xml.Linq.XComment
Public Sub New (other As XComment)

매개 변수

other
XComment

복사할 XComment 노드입니다.

예외

other 매개 변수가 null인 경우

설명

이 생성자는 주로 내부적으로 XML 트리의 전체 복사본을 만드는 데 사용됩니다.

추가 정보

적용 대상