IRdsDictionaryElement.MoveElement

Syntax

MoveElement(Target: IRdsDictionaryElement; MoveType: RdsMoveType);

Parameters

Target. Element, relative to which move is executed.

MoveType. Position, into which a current element is moved relative to the Target element.

Description

The MoveElement method moves an element of the MDM dictionary to the position specified relative to the given element.

Comments

It moves an element to any position with respect to the root element, except for RdsMoveType.Before (up to a specified element).

It is impossible to pass the Null value as the Target parameter.

Example

Executing the example requires an MDM repository with the RDS_REPO identifier that contains a dictionary with the OBJ_DICT identifier. It is also necessary to add links to the Metabase, Rds system assemblies.

    Sub UserProc;
    Var
        MB: IMetabase;
        RdsDescr: IMetabaseObjectDescriptor;
        Dict: IRdsDictionary;
        DictInst: IRdsDictionaryInstance;
        Elements: IRdsDictionaryElements;
        MoveElem, RootElem: IRdsDictionaryElement;
    Begin
        MB := MetabaseClass.Active;
        RdsDescr := MB.ItemById("RDS_REPO");
        Dict := MB.ItemByIdNamespace("OBJ_DICT", RdsDescr.Key).Bind As IRdsDictionary;
        DictInst := Dict.Open(Null);
        Elements := DictInst.Elements;
    // Receive the first element of a dictionary   
        MoveElem := Elements.Item(1);
    // Receive root element of a dictionary     
        RootElem := Elements.ItemElement(-2);
    // Move element 
        MoveElem.MoveElement(RootElem, RdsMoveType.LastChild);
    End Sub UserProc;

After executing the example the first element of a dictionary becomes the last one.

See also:

IRdsDictionaryElement