次の方法で共有


ContextNodeBase.PartiallyPopulated プロパティ

ContextNodeBase オブジェクトが一部だけ書き込まれているか、すべて書き込まれているかを示す値を取得または設定します。

名前空間 :  System.Windows.Ink.AnalysisCore
アセンブリ :  IACore (IACore.dll 内)

構文

'宣言
Public Property PartiallyPopulated As Boolean
'使用
Dim instance As ContextNodeBase
Dim value As Boolean

value = instance.PartiallyPopulated

instance.PartiallyPopulated = value
public bool PartiallyPopulated { get; set; }
public:
property bool PartiallyPopulated {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_PartiallyPopulated()
/** @property */
public  void set_PartiallyPopulated(boolean value)
public function get PartiallyPopulated () : boolean
public function set PartiallyPopulated (value : boolean)

プロパティ値

型 : System.Boolean
データ プロキシ処理中、ContextNodeBase オブジェクトに完全なデータが含まれていない場合は true。すべてのデータが追加されている場合は false。

解説

ツリーに関するすべての情報が使用可能になる前に ContextNodeBase オブジェクトがコンテキスト ノード ツリーで作成された場合は、データ プロキシにこのメソッドを使用します。このプロパティは、データの完全な書き込みが行われたかどうかを示します。

この値を true に設定すると、ContextNodeBase が RootNode、CustomRecognizer、AnalysisHint、または不明な ContextNode でない場合は、空ではない Location 値が必要です。

ストロークが削除されたためにストローク キャッシュでストロークが見つからず、ツリーの一部が PartiallyPopulated とマークされている場合、そのストロークを InkAnalyzer から削除する必要があることが、イベントを通してアプリケーションに通知されることはありません。アプリケーションがストロークを削除する必要があります。

ドキュメント ツリーを仮想化するときは、必ずすべての ContextNodeBase オブジェクトで PropertyGuidsForContextNodes.RotatedBoundingBox 値を設定します (ContextNode.AddPropertyValue を使用)。RotatedBoundingBox プロパティは InkAnalyzer により計算され、既定では書き込みを行うすべての ContextNodes に存在している必要があります。ただし、アプリケーションが PartiallyPopulated プロパティを設定することにより分析結果を仮想化する場合、PopulateContextNode イベントを処理するときは、RotatedBoundingBox プロパティを設定してください。RotatedBoundingBox プロパティを設定しない場合、現在の分析操作で使用されるドキュメント データが増える可能性があります。

次の例では、System.Windows.Forms.TreeView をドキュメント モデルとして使用して、InkAnalyzerBase のコンテキスト ノード ツリーの格納と読み込みにデータ プロキシを使用する方法を示すサンプル コードから、PopulateNode というメソッドを示します。各 TreeNode オブジェクトの Tag プロパティが DocumentNodeData オブジェクトに設定されている場合、DocumentNodeData クラスは ContextNodeBase データをドキュメント モデルに格納します。

PopulateNode メソッドは、ストローク、プロパティ データ、注釈の種類、子ノード、およびリンクを追加することにより、ContextNodeBase オブジェクトと InkAnalyzerBase オブジェクトを使用してコンテキスト ノードに完全に書き込みます。データは、対応する TreeNode から取得された DocumentNodeData オブジェクトにより生成されます。

  • this[analyzerNode.Id] は、GuidTreeNode に対応付けるドキュメント モデル クラスのインデクサです。

  • AddLinksToAnalyer は、ContextNodeBase にリンクを追加するドキュメント モデル クラス上のメソッドです。

ノードに完全に書き込みが行われたら、PartiallyPopulated プロパティが false に設定されます。

Sub PopulateNode(ByVal analyzerNode As Microsoft.Ink.ContextNode, _
                 ByVal theInkAnalyzer As Microsoft.Ink.InkAnalyzer) _
                 Implements IDocumentModel.PopulateNode

    System.Diagnostics.Debug.WriteLine( _
        String.Format("IDocumentModel.PopulateNode: populate {0} {1}.", _
        TreeViewDocumentModel.GetContextNodeTypeName(analyzerNode.Type), analyzerNode.Id))

    System.Diagnostics.Debug.Indent()

    ' Get the document node associated with the analyzer node.
    Dim documentNode As TreeNode = Me(analyzerNode.Id)
    If documentNode Is Nothing Then
        Throw New ApplicationException("The requested node does not exist in the document model.")
    End If

    ' Get the data associated with the node.
    Dim nodeData As DocumentNodeData = documentNode.Tag '

    ' Copy any application specific data associated with the node to the
    ' partially populated ContextNode.
    Dim identifier As Guid
    For Each identifier In nodeData.GetPropertyDataIds()
        analyzerNode.AddPropertyData(identifier, nodeData.GetPropertyData(identifier))
    Next identifier

    ' Check if the partially populated ContextNode is an ink leaf node.
    If nodeData.IsInkLeafNode Then
        ' Add the strokes to the context node.
        analyzerNode.SetStrokes(nodeData.Strokes)
    Else
        ' Add each child subnode as a partially populated ContextNode.
        Dim documentSubNode As TreeNode
        For Each documentSubNode In documentNode.Nodes
            ' Get the DocumentNode data for the 
            Dim subNodeData As DocumentNodeData = documentSubNode.Tag

            If analyzerNode.SubNodes.IndexOf(nodeData.Id) <> -1 Then
                analyzerNode.CreatePartiallyPopulatedSubNode( _
                    subNodeData.Type, subNodeData.Id, subNodeData.Location)
            End If

        Next documentSubNode
    End If

    ' Add links to the ContextNode.
    Me.AddLinksToAnalyzer(documentNode, analyzerNode, theInkAnalyzer)

    ' Update the partially populated flag.
    analyzerNode.PartiallyPopulated = False

    System.Diagnostics.Debug.Unindent()

End Sub 'IDocumentModel.PopulateNode
        void IDocumentModel.PopulateNode(
            Microsoft.Ink.ContextNode analyzerNode,
            Microsoft.Ink.InkAnalyzer theInkAnalyzer)
        {
            System.Diagnostics.Debug.WriteLine(string.Format(
                "IDocumentModel.PopulateNode: populate {0} {1}.",
                TreeViewDocumentModel.GetContextNodeTypeName(analyzerNode.Type),
                analyzerNode.Id));
            System.Diagnostics.Debug.Indent();

            // Get the document node associated with the analyzer node.
            TreeNode documentNode = this[analyzerNode.Id];
            if (null == documentNode)
            {
                throw new ApplicationException(
                    "The requested node does not exist in the document model.");
            }

            // Get the data associated with the node.
            DocumentNodeData nodeData = documentNode.Tag as DocumentNodeData;

            // Copy any application specific data associated with the node to the
            // partially populated ContextNode.
            foreach (Guid identifier in nodeData.GetPropertyDataIds())
            {
                analyzerNode.AddPropertyData(
                    identifier, nodeData.GetPropertyData(identifier));
            }

            // Check if the partially populated ContextNode is an ink leaf node.
            if (nodeData.IsInkLeafNode)
            {
                // Add the strokes to the context node.
                analyzerNode.SetStrokes(nodeData.Strokes);
            }
            else
            {
                // Add each child subnode as a partially populated ContextNode.
                foreach (TreeNode documentSubNode in documentNode.Nodes)
                {
                    // Get the DocumentNode data for the 
                    DocumentNodeData subNodeData = documentSubNode.Tag as DocumentNodeData;

                    if (analyzerNode.SubNodes.IndexOf(nodeData.Id) != -1)
                    {
                        analyzerNode.CreatePartiallyPopulatedSubNode(
                            subNodeData.Type, subNodeData.Id, subNodeData.Location);
                    }
                }
            }

            // Add links to the ContextNode.
            this.AddLinksToAnalyzer(documentNode, analyzerNode, theInkAnalyzer);

            // Update the partially populated flag.
            analyzerNode.PartiallyPopulated = false;

            System.Diagnostics.Debug.Unindent();
        }

プラットフォーム

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 名前空間

ContextNodeBase.CreatePartiallyPopulatedSubNode