다음을 통해 공유


TextWordNode.Data 속성

업데이트: 2007년 11월

TextWordNode 개체의 응용 프로그램 정의 데이터를 가져오거나 설정합니다.

네임스페이스:  System.Windows.Ink
어셈블리:  IAWinFX(IAWinFX.dll)

구문

‘선언
Public Property Data As Object
‘사용 방법
Dim instance As TextWordNode
Dim value As Object

value = instance.Data

instance.Data = value
public Object Data { get; set; }
public:
property Object^ Data {
    Object^ get ();
    void set (Object^ value);
}
/** @property */
public Object get_Data()
/** @property */
public  void set_Data(Object value)
public function get Data () : Object
public function set Data (value : Object)

속성 값

형식: System.Object
TextWordNode 개체의 응용 프로그램 정의 데이터입니다.

설명

이 속성을 사용하여 TextWordNode 개체에 사용자 고유의 데이터를 추가할 수 있습니다.

예제

다음 예제에서는 이름이 theTextBox인 TextBox 컨트롤에 대해 이름이 theInkAnalyzer인 InkAnalyzerTextWordNode 개체를 추가합니다. 그런 다음 TextWordNode 개체의 Data 속성을 TextBoxText 속성으로 설정합니다.

' Add nodes to hold the TextWordNode
Dim writingRegion As WritingRegionNode = _
    CType(theInkAnalyzer.RootNode.CreateSubNode(ContextNodeType.WritingRegion), _
    WritingRegionNode)

Dim paragraph As ParagraphNode = _
    CType(writingRegion.CreateSubNode(ContextNodeType.Paragraph), _
    ParagraphNode)

Dim line As LineNode = _
    CType(paragraph.CreateSubNode(ContextNodeType.Line), LineNode)

' Create node for the word
Dim textWord As TextWordNode = _
    CType(line.CreateSubNode(ContextNodeType.TextWord), TextWordNode)

' Set location
Dim textTop As Double = InkCanvas.GetTop(theTextBox)
Dim textLeft As Double = InkCanvas.GetLeft(theTextBox)

Dim rectLocation As New Rect(textLeft, textTop, theTextBox.Width, theTextBox.Height)
textWord.SetLocation(New AnalysisRegion(rectLocation))

' Set the data property to be the text in the textbox.
textWord.Data = theTextBox.Text

// Add nodes to hold the TextWordNode
WritingRegionNode writingRegion = (WritingRegionNode)
    theInkAnalyzer.RootNode.CreateSubNode(ContextNodeType.WritingRegion);
ParagraphNode paragraph = (ParagraphNode)
    writingRegion.CreateSubNode(ContextNodeType.Paragraph);
LineNode line = (LineNode)
    paragraph.CreateSubNode(ContextNodeType.Line);

// Create node for the word
TextWordNode textWord = (TextWordNode)
    line.CreateSubNode(ContextNodeType.TextWord);


// Set location
double textTop = InkCanvas.GetTop(theTextBox);
double textLeft = InkCanvas.GetLeft(theTextBox);

Rect rectLocation = new Rect(textLeft, textTop, theTextBox.Width, theTextBox.Height);
textWord.SetLocation(new AnalysisRegion(rectLocation));

// Set the data property to be the text in the textbox.
textWord.Data = theTextBox.Text;

플랫폼

Windows Vista

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

TextWordNode 클래스

TextWordNode 멤버

System.Windows.Ink 네임스페이스