IDynamicInstance.Clone

Fore Syntax

Clone(op: DynamicInstanceOperationsVisibility; Mark: Variant): IDynamicInstance;

Fore.NET Syntax

Clone(op: Prognoz.Platform.Interop.Dimensions.DynamicInstanceOperationsVisibility; Mark: object): Prognoz.Platform.Interop.Dimensions.DynamicInstance;

Parameters

op. Parameter determines to which dictionaries executed operation is applied.

Mark. Set to which dictionary will belong.

Description

The Clone method creates dictionary copy.

Fore Example

Executing the example requires a form containing the components:

Specify the UiDimension1 component as data source for the DimensionTree1 component and the UiDimension2 component as data source for the DimensionTree2 component. Data source for the UiDimension1 component must be MDM table dictionary with set dynamic loading of elements.

The example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Dim: IDynamicInstance;
    DimCopy: IDynamicInstance;
Begin
    Dim := UiDimension1.DimInstance As IDynamicInstance;
    // Create dictionary copy
    If Dim.CanClone(DynamicInstanceOperationsVisibility.Local, "Copy"Then
        DimCopy := Dim.Clone(DynamicInstanceOperationsVisibility.Local, "Copy");
        UiDimension2.Dimension := DimCopy.DimensionModel;
    End If;
End Sub Button1OnClick;

On clicking the Button1 button dictionary copy will be created. The copy will be displayed in the DimensionTree2 component.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore Example. Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Interop.Dimensions;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    Dim: IDynamicInstance;
    DimCopy: IDynamicInstance;
Begin
    Dim := uiDimensionNet1.DimInstance As IDynamicInstance;
    // Create dictionary copy
    If Dim.CanClone(DynamicInstanceOperationsVisibility.diovLocal, "Copy"Then
        DimCopy := Dim.Clone(DynamicInstanceOperationsVisibility.diovLocal, "Copy");
        uiDimensionNet2.Dimension := DimCopy.DimensionModel;
    End If;
End Sub;

See also:

IDynamicInstance