다음을 통해 공유


ContextNodeBase.Type 속성

업데이트: 2007년 11월

ContextNodeBase 개체의 컨텍스트 노드 형식을 가져옵니다.

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

구문

‘선언
Public ReadOnly Property Type As Guid
‘사용 방법
Dim instance As ContextNodeBase
Dim value As Guid

value = instance.Type
public Guid Type { get; }
public:
property Guid Type {
    Guid get ();
}
/** @property */
public Guid get_Type()
public function get Type () : Guid

속성 값

형식: System.Guid

예제

다음 예제에서는 이름이 selectedNode인 ContextNodeBase 개체의 Type 속성을 사용하는 방법을 보여 줍니다. TextBox의 텍스트인 selectedResultsTextBox는 노드 형식에 따라 다르게 채워집니다. 대부분의 경우 인식된 문자열이 사용되지만 InkWord의 경우에는 줄의 인식된 문자열이 사용되고 단어는 TextBox에서 선택됩니다.

If (selectedNode.ContainsPropertyData(PropertyGuidsForContextNodesBase.RecognizedString) AndAlso _
   (selectedNode.Type = System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.WritingRegion OrElse _
    selectedNode.Type = System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Paragraph OrElse _
    selectedNode.Type = System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.CustomRecognizer OrElse _
    selectedNode.Type = System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Object OrElse _
    selectedNode.Type = System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Line)) Then

    selectedResultsTextBox.Text = _
        CType(selectedNode.GetPropertyData(PropertyGuidsForContextNodesBase.RecognizedString), String)

ElseIf (selectedNode.Type = System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.InkWord) Then
    Dim parentNode As ContextNodeBase = selectedNode.ParentNode
    If (parentNode.Type = System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Line AndAlso _
            parentNode.ContainsPropertyData(PropertyGuidsForContextNodesBase.RecognizedString)) Then

        ' Put parent line's recognized string into the text box
        selectedResultsTextBox.Text = _
            CType(parentNode.GetPropertyData(PropertyGuidsForContextNodesBase.RecognizedString), String)

        ' Select the text that corresponds to the ink word
        Dim subNodes As New ContextNodeBaseCollection(theInkAnalyzerBase)
        subNodes.Add(selectedNode)
        Dim start As Integer
        Dim length As Integer
        theInkAnalyzerBase.GetTextRangeFromNodes(subNodes, start, length)
        If (start >= 0 AndAlso length > 0) Then
            selectedResultsTextBox.Select(start, length)
        End If
    End If
ElseIf (selectedNode.Type = System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.InkDrawing AndAlso _
        selectedNode.ContainsPropertyData(PropertyGuidsForContextNodesBase.ShapeName)) Then

    selectedResultsTextBox.Text = _
        CType(selectedNode.GetPropertyData(PropertyGuidsForContextNodesBase.ShapeName), String)

End If
if (selectedNode.ContainsPropertyData(PropertyGuidsForContextNodesBase.RecognizedString) &&
   (selectedNode.Type == System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.WritingRegion ||
    selectedNode.Type == System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Paragraph ||
    selectedNode.Type == System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.CustomRecognizer ||
    selectedNode.Type == System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Object ||
    selectedNode.Type == System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Line))
{
    selectedResultsTextBox.Text =
        (string)selectedNode.GetPropertyData(PropertyGuidsForContextNodesBase.RecognizedString);
}
else if (selectedNode.Type == System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.InkWord)
{
    ContextNodeBase parentNode = selectedNode.ParentNode;
    if (parentNode.Type == System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Line &&
        parentNode.ContainsPropertyData(PropertyGuidsForContextNodesBase.RecognizedString))
    {
        // Put parent line's recognized string into the text box
        selectedResultsTextBox.Text =
            (string)parentNode.GetPropertyData(PropertyGuidsForContextNodesBase.RecognizedString);

        // Select the text that corresponds to the ink word
        ContextNodeBaseCollection subNodes = new ContextNodeBaseCollection(theInkAnalyzerBase);
        subNodes.Add(selectedNode);
        int start;
        int length;
        theInkAnalyzerBase.GetTextRangeFromNodes(subNodes, out start, out length);
        if (start >= 0 && length > 0)
        {
            selectedResultsTextBox.Select(start, length);
        }
    }
}
else if (selectedNode.Type == System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.InkDrawing &&
         selectedNode.ContainsPropertyData(PropertyGuidsForContextNodesBase.ShapeName))
{
    selectedResultsTextBox.Text =
        (string)selectedNode.GetPropertyData(PropertyGuidsForContextNodesBase.ShapeName);

}

플랫폼

Windows Vista, Windows XP SP2, Windows Server 2003

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

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

ContextNodeBase 클래스

ContextNodeBase 멤버

System.Windows.Ink.AnalysisCore 네임스페이스

System.Windows.Ink.AnalysisCore.ContextNodeTypeBase

InkAnalyzerBase.FindNodesOfType

InkAnalyzerBase.FindNodesOfType

InkAnalyzerBase.FindNodesOfType