Share via


ContextNodeBase.MoveSubNodeToPosition Method

Reorders a specified child ContextNodeBase object to be at the specified index.

Namespace:  System.Windows.Ink.AnalysisCore
Assembly:  IACore (in IACore.dll)

Syntax

'Declaration
Public Sub MoveSubNodeToPosition ( _
    subNodeToMove As ContextNodeBase, _
    newIndex As Integer _
)
'Usage
Dim instance As ContextNodeBase 
Dim subNodeToMove As ContextNodeBase 
Dim newIndex As Integer

instance.MoveSubNodeToPosition(subNodeToMove, _
    newIndex)
public void MoveSubNodeToPosition(
    ContextNodeBase subNodeToMove,
    int newIndex
)
public:
void MoveSubNodeToPosition(
    ContextNodeBase^ subNodeToMove, 
    int newIndex
)
public function MoveSubNodeToPosition(
    subNodeToMove : ContextNodeBase, 
    newIndex : int
)

Parameters

Remarks

An ArgumentException is thrown if nodeToMove is not a child of the ContextNodeBase object.

Examples

The following example moves a ContextNodeBase, wordToMove, from its current spot in a line to one spot before. This could be part of a correction user interface where the user indicates that a selected word should have been placed one word earlier.

Dim parentNode As ContextNodeBase = wordToMove.ParentNode
Dim wordIndex As Integer = parentNode.SubNodes.IndexOf(wordToMove)
Dim newIndex As Integer = Math.Max(0, wordIndex - 1)
parentNode.MoveSubNodeToPosition(wordToMove, newIndex)
ContextNodeBase parentNode = wordToMove.ParentNode;
int wordIndex = parentNode.SubNodes.IndexOf(wordToMove);
int newIndex = Math.Max(0, wordIndex - 1);
parentNode.MoveSubNodeToPosition(wordToMove, newIndex);

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

ContextNodeBase Class

ContextNodeBase Members

System.Windows.Ink.AnalysisCore Namespace