Freigeben über


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 void MoveSubNodeToPosition (
    ContextNodeBase subNodeToMove, 
    int newIndex
)
public function MoveSubNodeToPosition (
    subNodeToMove : ContextNodeBase, 
    newIndex : int
)
Not applicable.

Parameters

  • newIndex
    The new position of the nodeToMoveContextNodeBase object. The index is zero-based.

Remarks

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

Example

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 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

ContextNodeBase Class
ContextNodeBase Members
System.Windows.Ink.AnalysisCore Namespace