この ContextNode オブジェクトから、指定した ContextNode オブジェクトにストロークを移動します。
名前空間 : System.Windows.Ink
アセンブリ : IAWinFX (IAWinFX.dll 内)
構文
'宣言
Public Sub ReparentStrokes ( _
strokes As StrokeCollection, _
destinationNode As ContextNode _
)
'使用
Dim instance As ContextNode
Dim strokes As StrokeCollection
Dim destinationNode As ContextNode
instance.ReparentStrokes(strokes, destinationNode)
public void ReparentStrokes(
StrokeCollection strokes,
ContextNode destinationNode
)
public:
void ReparentStrokes(
StrokeCollection^ strokes,
ContextNode^ destinationNode
)
public void ReparentStrokes(
StrokeCollection strokes,
ContextNode destinationNode
)
public function ReparentStrokes(
strokes : StrokeCollection,
destinationNode : ContextNode
)
パラメータ
- strokes
型 : System.Windows.Ink.StrokeCollection
移動する StrokeCollection。
- destinationNode
型 : System.Windows.Ink.ContextNode
ストロークの移動先の ContextNode オブジェクト。
解説
指定する ContextNode は、InkWordNode、InkDrawingNode、InkBulletNode、または UnclassifiedInkNode クラスのいずれかにする必要があります。他の型の ContextNode にストロークを移動しようとすると、ArgumentException が発生します。
このメソッドは、インク以外のリーフ ContextNode オブジェクトを含む、ContextNode オブジェクトから呼び出すことができます。指定されたストロークは、この ContextNode オブジェクトのいずれかの子孫が参照する必要があります。参照しない場合は、ArgumentException が発生します。
ContextNode オブジェクトまたは destinationNode のどちらかが確認済みの場合、例外が発生します。
例
次の例では、InkDrawingNode オブジェクトのコレクションで構成される、inkDrawingsToCombine という名前の ContextNodeCollection を使用します。例では、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 = firstNode Then
GoTo ContinueForEach1
End If
' Reparent all strokes to the first node
drawingNode.ReparentStrokes(drawingNode.Strokes, firstNode)
' Delete this node
drawingNode.ParentNode.DeleteSubNode(drawingNode)
ContinueForEach1:
Next drawingNode
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