Clone(op: DynamicInstanceOperationsVisibility; Mark: Variant): IDynamicInstance;
Clone(op: Prognoz.Platform.Interop.Dimensions.DynamicInstanceOperationsVisibility; Mark: object): Prognoz.Platform.Interop.Dimensions.DynamicInstance;
op. Parameter determines to which dictionaries executed operation is applied.
Mark. Set to which dictionary will belong.
The Clone method creates dictionary copy.
Executing the example requires a form containing the components:
DimensionTree with the DimensionTree1 identifier.
DimensionTree with the DimensionTree2 identifier.
UiDimension with the UiDimension1 identifier.
UiDimension with the UiDimension2 identifier.
Button with the Button1 identifier.
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.
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: