ContextNode オブジェクトが確認済みかどうかを示す値を取得します。InkAnalyzer は、確認済みオブジェクトのノードの型と関連付けられたストロークを変更できません。
名前空間 : Microsoft.Ink
アセンブリ : Microsoft.Ink.Analysis (Microsoft.Ink.Analysis.dll 内)
構文
'宣言
Public Function IsConfirmed ( _
type As ConfirmationType _
) As Boolean
'使用
Dim instance As ContextNode
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
型 : Microsoft.Ink.ConfirmationType
チェックする確認の型。
戻り値
型 : System.Boolean
ノードの型が確認済みである場合は true。それ以外の場合は false。
例
次の例では、IsConfirmed() メソッドを使用して ContextNode の確認状態を切り替えます。この例では、InkCollector、theInkCollector を介してインクを収集する Panel、theNotesPanel の Control.MouseUp イベントのイベント ハンドラを示します。アプリケーションには、MenuItem、confirmMenuItem により Boolean、confirmMode が設定されています。"確認" モードの場合、ユーザーは単語をクリックして確認します (または、ノードが既に確認済みの場合は確認を無効にします)。この例では、マウス アップ イベントをインク座標に変換します。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)
' Find the ink word nodes that correspond to those strokes
Dim selectedNodes As ContextNodeCollection = _
Me.theInkAnalyzer.FindNodesOfType(Microsoft.Ink.ContextNodeType.InkWord, _
selectedStrokes)
' Toggle the confirmation type on these nodes
Dim selectedNode As ContextNode
For Each selectedNode In selectedNodes
If selectedNode.IsConfirmed(ConfirmationType.NodeTypeAndProperties) = True Then
selectedNode.Confirm(Microsoft.Ink.ConfirmationType.None)
Else
selectedNode.Confirm(Microsoft.Ink.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);
// Find the ink word nodes that correspond to those strokes
ContextNodeCollection selectedNodes =
this.theInkAnalyzer.FindNodesOfType(Microsoft.Ink.ContextNodeType.InkWord,
selectedStrokes);
// Toggle the confirmation type on these nodes
foreach (ContextNode selectedNode in selectedNodes)
{
if (selectedNode.IsConfirmed(ConfirmationType.NodeTypeAndProperties))
{
selectedNode.Confirm(Microsoft.Ink.ConfirmationType.None);
}
else
{
selectedNode.Confirm(Microsoft.Ink.ConfirmationType.NodeTypeAndProperties);
}
}
// No longer in "confirm" mode
this.confirmMode = false;
this.confirmMenuItem.Checked = false;
this.theInkCollector.Enabled = true;
}
}
プラットフォーム
Windows Vista
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 3.0