ConfirmationType 列舉型別
定義值,這些值指定能出現在 ContextNodeBase 物件上的型別確認。
這個列舉型別的 FlagsAttribute 屬性允許將其成員值以位元組合的方式來使用。
命名空間: System.Windows.Ink.AnalysisCore
組件: IACore (在 IACore.dll 中)
語法
'宣告
<FlagsAttribute> _
Public Enumeration ConfirmationType
'用途
Dim instance As ConfirmationType
[FlagsAttribute]
public enum ConfirmationType
[FlagsAttribute]
public enum class ConfirmationType
/** @attribute FlagsAttribute */
public enum ConfirmationType
public enum ConfirmationType
成員
成員名稱 | 說明 | |
---|---|---|
None | 指定不套用確認。InkAnalyzer 可以視需要隨意變更內容節點或任何其子代 (Descendant)。 | |
NodeTypeAndProperties | 指定 InkAnalyzer 無法變更所指定之內容節點的型別或任何屬性。 | |
TopBoundary | 指定 InkAnalyzerBase 將不執行作業,包括加入連結或與其他會使 TopBoundary 移動超過目前頂端界限的 ContextNodeBases 合併。例如: |
備註
您只能對 InkWord 和 InkDrawing 型別的 ContextNodeBase 物件使用 NodeTypeAndProperties,否則,會擲回 InvalidOperationException。
範例
下列範例是 Panel (名為 theNotesPanel) 上 MouseUp 事件的事件處理常式,會透過 InkCollector (名為 theInkCollector) 收集筆墨。應用程式具有 Boolean 值 (confirmMode),該值是由 MenuItem (名為 confirmMenuItem) 設定。在「確認」模式下,使用者按一下文字即可加以確認 (或如果已確認節點即可關閉確認)。這個範例會將 MouseUp 事件轉換成筆墨座標,並且使用 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
請參閱
參考
System.Windows.Ink.AnalysisCore 命名空間
ContextNodeBaseIsNodeTypeAndPropertiesConfirmed()