Copies a time series database.
Command parameters are passed in the Data property. Executing the command requires to specify the following value in this property:
Value type | Description |
IMetabaseObjectCopyInfo | The object with copy parameters of the Time Series Database repository object. |
The command can be used for time series database only.
Executing the example requires that the repository contains a time series database with the FC identifier. Create a form and place a button with the Button1 identifier on the form. Connect the Metabase, Fore and Ui system assemblies.
The example is a handler of the OnClick event for Button1.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
Target: IUiCommandTarget;
Context: IUiCommandExecutionContext;
CInfo: IMetabaseObjectCopyInfo;
Begin
MB := MetabaseClass.Active;
CInfo := MB.CreateCopyInfo;
CInfo.Id := MB.GenerateId("FC_COPY");
CInfo.Name := Copy of time series database;
CInfo.WithData := True;
CInfo.Source := MB.ItemById("FC");
CInfo.Destination := MB.Root;
Target := WinApplication.Instance.GetPluginTarget("Cubes");
Context := Target.CreateExecutionContext;
Context.Data := CInfo;
Target.Execute("CopyRubricator", Context);
End Sub Button1OnClick;
Clicking the button copies the time series database with data.
Executing the example requires that the repository contains a time series database with the FC identifier. Create a .NET form and place a button with the Button1 identifier on the form.
The example is a handler of the OnClick event for Button1.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Ui;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
MB: IMetabase;
Target: IUiCommandTarget;
Context: IUiCommandExecutionContext;
CInfo: IMetabaseObjectCopyInfo;
Wa: WinApplicationClassClass;
Begin
MB := Self.Metabase;
CInfo := MB.CreateCopyInfo();
CInfo.Id := MB.GenerateId("FC_COPY", 0);
CInfo.Name := Copy of time series database;
CInfo.WithData := True;
CInfo.Source := MB.ItemById["FC"];
CInfo.Destination := MB.Root;
Wa := New WinApplicationClassClass();
Target := Wa.Instance[Null].GetPluginTarget("Cubes");
Context := Target.CreateExecutionContext();
Context.Data := CInfo;
Target.Execute("CopyRubricator", Context, Null);
End Sub;
Clicking the button copies the time series database with data.
See also: