ContextNode.ReparentStrokes - метод
Обновлен: Ноябрь 2007
Moves a stroke from this ContextNode object to the specified ContextNode object.
Пространство имен: 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
)
Параметры
- strokes
Тип: Microsoft.Ink.Strokes
The Strokes to move.
- destinationNode
Тип: Microsoft.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 results 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 or an ArgumentException is raised.
If either the ContextNode object or the destinationNode is confirmed, an exception is raised.
Примеры
The following example uses a ContextNodeCollection, 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.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