ContextNodeBase オブジェクトの直接の子を取得します。
名前空間 : System.Windows.Ink.AnalysisCore
アセンブリ : IACore (IACore.dll 内)
構文
'宣言
Public ReadOnly Property SubNodes As ContextNodeBaseCollection
'使用
Dim instance As ContextNodeBase
Dim value As ContextNodeBaseCollection
value = instance.SubNodes
public ContextNodeBaseCollection SubNodes { get; }
public:
property ContextNodeBaseCollection^ SubNodes {
ContextNodeBaseCollection^ get ();
}
/** @property */
public ContextNodeBaseCollection get_SubNodes()
public function get SubNodes () : ContextNodeBaseCollection
プロパティ値
型 : System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection
ContextNodeBase オブジェクトの直接の子。
解説
すべての子孫ではなく、直接の子だけを返します。
例
ContextNodeBase オブジェクトのツリーを再帰的に処理するメソッドを次の例に示します。TreeNode オブジェクトを追加することにより、SubNodes プロパティを使用して System.Windows.Forms.TreeView に書き込みます。次に、それらの Text プロパティを ToString に設定し、認識された文字列または該当する場合は図形の名前を追加します。
Private Sub WalkTree(ByVal parentContextNode As ContextNodeBase, ByVal parentTreeNode As TreeNode)
Dim cNode As ContextNodeBase
For Each cNode In parentContextNode.SubNodes
Dim newTNode As New TreeNode(cNode.ToString())
If cNode.Type = System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.InkWord AndAlso _
cNode.ContainsPropertyData(PropertyGuidsForContextNodesBase.RecognizedString) Then
newTNode.Text = newTNode.Text + _
": " + CType(cNode.GetPropertyData(PropertyGuidsForContextNodesBase.RecognizedString), _
String)
ElseIf cNode.Type = System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.InkDrawing AndAlso _
cNode.ContainsPropertyData(PropertyGuidsForContextNodesBase.ShapeName) Then
Dim shapeName As String = CType(cNode.GetPropertyData(PropertyGuidsForContextNodesBase.ShapeName), _
String)
If shapeName <> "" Then
newTNode.Text = newTNode.Text + ": " + shapeName
End If
End If
WalkTree(cNode, newTNode)
parentTreeNode.Nodes.Add(newTNode)
' Add the context node as a tag of the tree node
newTNode.Tag = cNode
Next cNode
End Sub 'WalkTree
private void WalkTree(
System.Windows.Ink.AnalysisCore.ContextNodeBase parentContextNode, TreeNode parentTreeNode)
{
foreach (ContextNodeBase cNode in parentContextNode.SubNodes)
{
TreeNode newTNode = new TreeNode(cNode.ToString());
if ((cNode.Type == System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.InkWord) &&
cNode.ContainsPropertyData(PropertyGuidsForContextNodesBase.RecognizedString))
{
// Get the recognized string
newTNode.Text += ": " +
(string)cNode.GetPropertyData(PropertyGuidsForContextNodesBase.RecognizedString);
}
else if ((cNode.Type == System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.InkDrawing) &&
cNode.ContainsPropertyData(PropertyGuidsForContextNodesBase.ShapeName))
{
newTNode.Text += ": " +
(string)cNode.GetPropertyData(PropertyGuidsForContextNodesBase.ShapeName);
}
WalkTree(cNode, newTNode);
parentTreeNode.Nodes.Add(newTNode);
// Add the context node as a tag of the tree node
newTNode.Tag = cNode;
}
}
プラットフォーム
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 3.0
参照
参照
System.Windows.Ink.AnalysisCore 名前空間
ContextNodeBase.SubNodes