ContextNodeBase.IsConfirmed 메서드
업데이트: 2007년 11월
ContextNodeBase 개체가 확인되었는지 여부를 나타내는 값을 가져옵니다. InkAnalyzerBase는 확인된 개체에 대한 노드 형식과 관련 스트로크를 변경할 수 없습니다.
네임스페이스: System.Windows.Ink.AnalysisCore
어셈블리: IACore(IACore.dll)
구문
‘선언
Public Function IsConfirmed ( _
type As ConfirmationType _
) As Boolean
‘사용 방법
Dim instance As ContextNodeBase
Dim type As ConfirmationType
Dim returnValue As Boolean
returnValue = instance.IsConfirmed(type)
public bool IsConfirmed(
ConfirmationType type
)
public:
bool IsConfirmed(
ConfirmationType type
)
public boolean IsConfirmed(
ConfirmationType type
)
public function IsConfirmed(
type : ConfirmationType
) : boolean
매개 변수
- type
형식: System.Windows.Ink.AnalysisCore.ConfirmationType
확인 형식입니다.
반환 값
형식: System.Boolean
노드 형식이 확인되었으면 true이고, 그렇지 않으면 false입니다.
설명
이 값은 Confirm 메서드로 설정됩니다.
예제
다음 예제는 Panel, theNotesPanel의 MouseUp 이벤트에 대한 이벤트 처리기입니다. 이 이벤트 처리기는 이름이 theInkCollector인 InkCollector를 통해 잉크를 수집합니다. 응용 프로그램에는 이름이 confirmMode인 Boolean 값이 있습니다. 이 값은 이름이 confirmMenuItem인 MenuItem으로 설정됩니다. "확인" 모드인 경우 사용자가 단어를 클릭하여 확인합니다(또는 노드가 이미 확인된 경우에는 확인을 해제). 이 예제에서는 마우스 단추 놓기 이벤트를 잉크 좌표로 변환합니다. 이 예제에서는 HitTest 및 FindNodesOfType을 사용하여 해당 노드를 찾습니다. 노드를 찾은 후 Confirm을 호출하여 확인 여부를 전환합니다. 마지막으로 응용 프로그램을 "확인" 모드에서 해제합니다.
Private Sub theNotesPanel_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles theNotesPanel.MouseUp
If Me.confirmMode = True Then
' Translate coordinates into ink dimensions
Dim hitPoint As New Point(e.X, e.Y)
Dim panelGraphics As Graphics = Me.theNotesPanel.CreateGraphics()
Me.theInkCollector.Renderer.PixelToInkSpace(panelGraphics, hitPoint)
panelGraphics.Dispose()
' Find the strokes that the user selected
Dim selectedStrokes As Strokes = Me.theInkCollector.Ink.HitTest(hitPoint, 10)
' The integer array must be exactly the right size. Arrays
' begin at zero, so the upper bound is selectedStrokes.Count - 1.
Dim selectedStrokeIds(selectedStrokes.Count - 1) As Integer
For i As Integer = 0 To selectedStrokes.Count - 1
selectedStrokeIds(i) = selectedStrokes(i).Id
Next
' Find the ink word nodes that correspond to those strokes
Dim selectedNodes As ContextNodeBaseCollection = _
Me.theInkAnalyzerBase.FindNodesOfType(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.InkWord, _
selectedStrokeIds)
' Toggle the confirmation type on these nodes
Dim selectedNode As ContextNodeBase
For Each selectedNode In selectedNodes
If selectedNode.IsConfirmed( _
Windows.Ink.AnalysisCore.ConfirmationType.NodeTypeAndProperties) Then
selectedNode.Confirm(System.Windows.Ink.AnalysisCore.ConfirmationType.None)
Else
selectedNode.Confirm(System.Windows.Ink.AnalysisCore.ConfirmationType.NodeTypeAndProperties)
End If
Next selectedNode
' No longer in "confirm" mode
Me.confirmMode = False
Me.ConfirmMenuItem.Checked = False
Me.theInkCollector.Enabled = True
End If
End Sub
private void theNotesPanel_MouseUp(object sender, MouseEventArgs e)
{
if (this.confirmMode)
{
// Translate coordinates into ink dimensions
Point hitPoint = new Point(e.X, e.Y);
Graphics panelGraphics = this.theNotesPanel.CreateGraphics();
this.theInkCollector.Renderer.PixelToInkSpace(panelGraphics, ref hitPoint);
panelGraphics.Dispose();
// Find the strokes that the user selected
Strokes selectedStrokes = this.theInkCollector.Ink.HitTest(hitPoint, 10);
int[] selectedStrokeIds = new int[selectedStrokes.Count];
for (int i = 0; i < selectedStrokes.Count; i++)
{
selectedStrokeIds[i] = selectedStrokes[i].Id;
}
// Find the ink word nodes that correspond to those strokes
ContextNodeBaseCollection selectedNodes =
this.theInkAnalyzerBase.FindNodesOfType(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.InkWord,
selectedStrokeIds);
// Toggle the confirmation type on these nodes
foreach (ContextNodeBase selectedNode in selectedNodes)
{
if (selectedNode.IsConfirmed(
System.Windows.Ink.AnalysisCore.ConfirmationType.NodeTypeAndProperties))
{
selectedNode.Confirm(System.Windows.Ink.AnalysisCore.ConfirmationType.None);
}
else
{
selectedNode.Confirm(System.Windows.Ink.AnalysisCore.ConfirmationType.NodeTypeAndProperties);
}
}
// No longer in "confirm" mode
this.confirmMode = false;
this.confirmMenuItem.Checked = false;
this.theInkCollector.Enabled = true;
}
}
플랫폼
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
3.0에서 지원