この ContextNodeBase オブジェクトを現在の親から削除して、別の親に追加します。
名前空間 : System.Windows.Ink.AnalysisCore
アセンブリ : IACore (IACore.dll 内)
構文
'宣言
Public Sub Reparent ( _
newParentNode As ContextNodeBase _
)
'使用
Dim instance As ContextNodeBase
Dim newParentNode As ContextNodeBase
instance.Reparent(newParentNode)
public void Reparent(
ContextNodeBase newParentNode
)
public:
void Reparent(
ContextNodeBase^ newParentNode
)
public void Reparent(
ContextNodeBase newParentNode
)
public function Reparent(
newParentNode : ContextNodeBase
)
パラメータ
- newParentNode
型 : System.Windows.Ink.AnalysisCore.ContextNodeBase
この ContextNodeBase オブジェクトの新しい親。
例
この例では、TypeLine のすべての ContextNodeBase オブジェクトを取り上げて、それらを Paragraph 型の独自の ContextNodeBase オブジェクトに配置します。また、InkAnalyzerBase の行を使用することにより、theInkAnalyzerBase; がそれらの各行の新しい段落サブノードを作成して、行の親をそれらの新しい段落に設定し、元の段落を削除します。
' Take each line and make it its own paragraph
Dim originalParagraphs As ContextNodeBaseCollection = _
theInkAnalyzerBase.FindNodesOfType(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Paragraph)
Dim lines As ContextNodeBaseCollection = _
theInkAnalyzerBase.FindNodesOfType(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Line)
Dim lineNode As ContextNodeBase
For Each lineNode In lines
' Create a new alignment level and paragraph
Dim lineParagraph As ContextNodeBase = lineNode.ParentNode
Dim writingRegion As ContextNodeBase = lineParagraph.ParentNode
Dim newParagraph As ContextNodeBase = _
writingRegion.CreateSubNode(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Paragraph)
' Reparent the line
lineNode.Reparent(newParagraph)
Next lineNode
' Remove original paragraphs and alignment nodes
Dim originalParagraph As ContextNodeBase
For Each originalParagraph In originalParagraphs
Dim originalAlignmentLevel As ContextNodeBase = originalParagraph.ParentNode
originalAlignmentLevel.DeleteSubNode(originalParagraph)
originalAlignmentLevel.ParentNode.DeleteSubNode(originalAlignmentLevel)
Next originalParagraph
// Take each line and make it its own paragraph
ContextNodeBaseCollection originalParagraphs =
theInkAnalyzerBase.FindNodesOfType(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Paragraph);
ContextNodeBaseCollection lines =
theInkAnalyzerBase.FindNodesOfType(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Line);
foreach (ContextNodeBase lineNode in lines)
{
// Create a new paragraph
ContextNodeBase paragraph = lineNode.ParentNode;
ContextNodeBase writingRegion = paragraph.ParentNode;
ContextNodeBase newParagraph =
writingRegion.CreateSubNode(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Paragraph);
// Reparent the line
lineNode.Reparent(newParagraph);
}
// Remove original paragraphs
foreach (ContextNodeBase originalParagraph in originalParagraphs)
{
ContextNodeBase originalWritingRegion = originalParagraph.ParentNode;
originalWritingRegion.DeleteSubNode(originalParagraph);
}
プラットフォーム
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 3.0