共用方式為


ContextNodeBase.PartiallyPopulated 屬性

取得或設定值,這個值表示 ContextNodeBase 物件為部分或全部填入 (Populate)。

命名空間:  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 物件在資料 Proxy 程序期間未包含完整的資料,則為 true,如果已加入全部資料,則為 false。

備註

在內容節點樹狀目錄中提供所有資訊之前,若要在其中建立 ContextNodeBase 物件,請使用這個方法進行資料 Proxy。這個屬性表示是否已填入所有資料。

將這個值設定為 true 時,如果 ContextNodeBase 不是 RootNode、CustomRecognizer、AnalysisHint 或未知的 ContextNode,則必須具有非空白的 Location 值。

如果筆劃已刪除且在筆劃快取中找不到筆劃,同時部分樹狀目錄標記為 PartiallyPopulated,則不會透過事件通知應用程式應從 InkAnalyzer 中移除該筆劃。應用程式會負責移除筆劃。

虛擬化文件樹狀結構時,務必在所有 ContextNodeBase 物件上設定 PropertyGuidsForContextNodes.RotatedBoundingBox 值 (使用 ContextNode.AddPropertyValue)。RotatedBoundingBox 屬性是透過 InkAnalyzer 計算,而且根據預設應在所有書寫 ContextNodes 上。不過,如果您的應用程式透過設定 PartiallyPopulated 屬性來虛擬化分析結果,則務必在處理 PopulateContextNode 事件時填入 RotatedBoundingBox 屬性。若未設定 RotatedBoundingBox 屬性,可能會造成在目前分析作業中使用更多文件資料。

範例

下列範例是從範例程式碼呼叫的 PopulateNode, 的方法,該範例程式碼使用 System.Windows.Forms.TreeView 做為文件模型,以顯示如何使用資料 Proxy 儲存和載入 InkAnalyzerBase 的內容節點樹狀目錄。DocumentNodeData 類別會在每個 TreeNode 物件的 Tag 屬性設定為 DocumentNodeData 物件時,儲存文件模型中的 ContextNodeBase 資料。

PopulateNode 方法會使用 ContextNodeBase 物件和 InkAnalyzerBase 物件,透過加入筆劃、屬性資料、註釋型別、子節點和連結完整地填入內容節點。資料來自 DocumentNodeData 物件,而該物件是從對應的 TreeNode 取得。

  • this[analyzerNode.Id] 是文件模型類別上的索引子 (Indexer),會將 Guid 對應至 TreeNode

  • 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