ContextNode.ReparentStrokes - метод
Обновлен: Ноябрь 2007
Moves a stroke from this ContextNode object to the specified ContextNode object.
Пространство имен: 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
The StrokeCollection to move.
- destinationNode
Тип: System.Windows.Ink.ContextNode
The ContextNode object that the stroke should be moved to.
Заметки
The specified ContextNode must be one of the following classes: InkWordNode, InkDrawingNode, InkBulletNode or UnclassifiedInkNode. Attempting to move a stroke to any other type of ContextNode will result in an ArgumentException.
This method can be called from any ContextNode object, including non-ink leaf ContextNode objects. The specified stroke must be referenced by one of the descendants of this ContextNode object; otherwise, an ArgumentException is raised.
If either the ContextNode object or the destinationNode is confirmed, an exception is raised.
Примеры
The following example uses a ContextNodeCollection named inkDrawingsToCombine that consists of a collection of InkDrawingNode objects. The example combines them into one InkDrawingNode object by using the ReparentStrokes method.
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