次の方法で共有


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 は、コンテキスト ノード、またはその子孫ノードのいずれかを必要に応じて自由に変更できます。
NodeTypeAndProperties InkAnalyzer が指定されたコンテキスト ノードの型またはプロパティを変更できないように指定します。
TopBoundary InkAnalyzerBase がインクの追加、他の ContextNodeBases とのマージなどの操作を行わず、TopBoundary が現在の一番上の境界を越えて移動するように指定します。例 :

解説

InkWord 型および InkDrawing 型の ContextNodeBase オブジェクトには、NodeTypeAndProperties のみ使用できます。それ以外の場合は、InvalidOperationException がスローされます。

次の例では、theInkCollector という名前の InkCollector によってインクを収集する、theNotesPanel という名前の PanelMouseUp イベントのイベント ハンドラの例を示します。アプリケーションには、confirmMenuItem という名前の MenuItem によって設定される、Boolean 値 confirmMode があります。"確認" モードでは、ユーザーは単語をクリックして確認します (または、ノードが既に確認済みの場合は確認を無効にします)。次の例では、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 名前空間

ContextNodeBase.Confirm

ContextNodeBaseIsNodeTypeAndPropertiesConfirmed()