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 必须是以下类中的一个:InkWordNodeInkDrawingNodeInkBulletNodeUnclassifiedInkNode。尝试将笔画移动到任何其他类型的 ContextNode 将导致引发 ArgumentException

此方法可以从任何 ContextNode 对象调用,包括非墨迹叶 ContextNode 对象。指定的笔画必须由此 ContextNode 对象的一个后代引用,否则会引发 ArgumentException

如果确认了 ContextNode 对象和 destinationNode 中的任何一个,则引发异常。

示例

下面的示例使用由 InkDrawingNode 对象集合组成的 ContextNodeCollection (inkDrawingsToCombine)。该示例使用 ReparentStrokes 方法将这些对象合并到一个 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 命名空间