IRdsDictionaryElements.Move

Syntax

Move(Element: Integer; InPlaceElement: Integer);

Parameters

Element - key of an element that is necessary to move.

InPlaceElement - key of an element, the Element element is put on its place.

Description

The Move method moves two elements of the MDM dictionary. Element move is available within one parent element.

Example

Executing the example requires the MDM repository NSI_1 that contains an MDM dictionary with the Dict_1 identifier.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    MB: IMetabase;
    Dict: IRdsDictionary;
    DictInst: IRdsDictionaryInstance;
    Elements: IRdsDictionaryElements;
    Elem1, Elem2: Integer;
Begin
    MB := MetabaseClass.Active;
    Dict := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Bind As IRdsDictionary;
    DictInst := Dict.Open(Null);
    Elements := DictInst.Elements;
    Elem1 := Elements.Child(-20);
    Elem2 := Elements.Child(-2, Elements.ChildrenCount(-2) - 1);
    Elements.Move(Elem1, Elem2);
End Sub Button1OnClick;

After executing the example the first and the last root elements of the MDM dictionary exchange their positions.

See also:

IRdsDictionaryElements