XComment.Value 속성

정의

이 주석의 문자열 값을 가져오거나 설정합니다.

public:
 property System::String ^ Value { System::String ^ get(); void set(System::String ^ value); };
public string Value { get; set; }
member this.Value : string with get, set
Public Property Value As String

속성 값

이 주석의 문자열 값이 들어 있는 String입니다.

예외

valuenull인 경우

예제

다음 예제에서는 주석 노드를 만듭니다. 그런 다음 주석 노드의 내용을 검색합니다.

XComment com = new XComment("This is a comment");  
Console.WriteLine(com.Value);  
Dim com As XComment = New XComment("This is a comment")  
Console.WriteLine(com.Value)  

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

This is a comment  

설명

및 와 XAttribute달리 XElement 주석의 내용을 문자열로 캐스팅하여 검색할 수 없습니다. 대신 이 속성을 사용하여 콘텐츠를 검색해야 합니다.

이 속성을 설정하면 및 이벤트가 발생 Changed 합니다 Changing .

적용 대상

추가 정보