次の方法で共有


ContextNode.ReparentStrokes メソッド

この ContextNode オブジェクトから、指定した ContextNode オブジェクトにストロークを移動します。

名前空間 :  Microsoft.Ink
アセンブリ :  Microsoft.Ink.Analysis (Microsoft.Ink.Analysis.dll 内)

構文

'宣言
Public Sub ReparentStrokes ( _
    strokes As Strokes, _
    destinationNode As ContextNode _
)
'使用
Dim instance As ContextNode
Dim strokes As Strokes
Dim destinationNode As ContextNode

instance.ReparentStrokes(strokes, destinationNode)
public void ReparentStrokes(
    Strokes strokes,
    ContextNode destinationNode
)
public:
void ReparentStrokes(
    Strokes^ strokes, 
    ContextNode^ destinationNode
)
public void ReparentStrokes(
    Strokes strokes,
    ContextNode destinationNode
)
public function ReparentStrokes(
    strokes : Strokes, 
    destinationNode : ContextNode
)

パラメータ

解説

指定する ContextNode は、InkWordNodeInkDrawingNodeInkBulletNode、または UnclassifiedInkNode クラスのいずれかにする必要があります。他の型の ContextNode にストロークを移動しようとすると、ArgumentException が発生します。

このメソッドは、インク以外のリーフ ContextNode オブジェクトを含む、ContextNode オブジェクトから呼び出すことができます。指定されたストロークは、この ContextNode オブジェクトのいずれかの子孫が参照する必要があります。参照しない場合は、ArgumentException が発生します。

ContextNode オブジェクトまたは destinationNode のどちらかが確認済みの場合、例外が発生します。

次の例では、InkDrawingNode オブジェクトのコレクションで構成される ContextNodeCollection、inkDrawingsToCombine を使用します。例では、ReparentStrokes メソッドを使用して、1 つの InkDrawingNode オブジェクトに結合します。

Dim firstNode As InkDrawingNode = CType(inkDrawingsToCombine(0), InkDrawingNode)
Dim drawingNode As InkDrawingNode
For Each drawingNode In inkDrawingsToCombine
    ' Skip first stroke
    If drawingNode.Equals(firstNode) Then Continue For

    ' Reparent all strokes to the first node
    drawingNode.ReparentStrokes(drawingNode.Strokes, firstNode)

    ' Delete this node
    drawingNode.ParentNode.DeleteSubNode(drawingNode)
Next
            InkDrawingNode firstNode = (InkDrawingNode) inkDrawingsToCombine[0];
            foreach (InkDrawingNode drawingNode in inkDrawingsToCombine)
            {
                // Skip first stroke
                if (drawingNode == firstNode)
                    continue;

                // Reparent all strokes to the first node
                drawingNode.ReparentStrokes(drawingNode.Strokes, firstNode);

                // Delete this node
                drawingNode.ParentNode.DeleteSubNode(drawingNode);
            }

プラットフォーム

Windows Vista

.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

ContextNode クラス

ContextNode メンバ

Microsoft.Ink 名前空間