ContextNode.MoveSubNodeToPosition Method
Reorders a specified child ContextNode object so that it moves to the specified index.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink.Analysis (in microsoft.ink.analysis.dll)
Syntax
'Declaration
Public Sub MoveSubNodeToPosition ( _
subNodeToMove As ContextNode, _
newIndex As Integer _
)
'Usage
Dim instance As ContextNode
Dim subNodeToMove As ContextNode
Dim newIndex As Integer
instance.MoveSubNodeToPosition(subNodeToMove, newIndex)
public void MoveSubNodeToPosition (
ContextNode subNodeToMove,
int newIndex
)
public:
void MoveSubNodeToPosition (
ContextNode^ subNodeToMove,
int newIndex
)
public void MoveSubNodeToPosition (
ContextNode subNodeToMove,
int newIndex
)
public function MoveSubNodeToPosition (
subNodeToMove : ContextNode,
newIndex : int
)
Not applicable.
Parameters
- subNodeToMove
The child ContextNode object to be reordered.
- newIndex
The new position of the nodeToMoveContextNode object.
Remarks
An ArgumentExceptionArgumentException is thrown if nodeToMove is not a child of the ContextNode object.
Example
The following example moves an InkWordNode, wordToMove
, from its current index in a line to one index earlier. This code could be part of a text correction user interface where the user indicates that a selected word should have been placed one word earlier.
Dim parentNode As ContextNode = wordToMove.ParentNode
Dim wordIndex As Integer = parentNode.SubNodes.IndexOf(wordToMove)
Dim newIndex As Integer = Math.Max(0, wordIndex - 1)
parentNode.MoveSubNodeToPosition(wordToMove, newIndex)
ContextNode parentNode = wordToMove.ParentNode;
int wordIndex = parentNode.SubNodes.IndexOf(wordToMove);
int newIndex = Math.Max(0, wordIndex - 1);
parentNode.MoveSubNodeToPosition(wordToMove, newIndex);
Platforms
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.
Version Information
.NET Framework
Supported in: 3.0
See Also
Reference
ContextNode Class
ContextNode Members
Microsoft.Ink Namespace