IMetabase.CreateUpdate

Syntax

CreateUpdate: IMetabaseUpdate;

CreateUpdate(): Prognoz.Platform.Interop.Metabase.IMetabaseUpdate;

Description

The CreateUpdate method creates an object of update.

Example

Executing the example requires that the repository contains an assembly with the Assembly_1 identifier. This assembly contains any modules and forms.

Add links to the ForeSystem, Metabase system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    MUpdate: IMetabaseUpdate;
    RootFolder: IMetabaseUpdateFolderNode;
    Node: IMetabaseUpdateObjectNode;
Begin
    Mb := MetabaseClass.Active;
    MUpdate := Mb.CreateUpdate;
    RootFolder := MUpdate.RootFolder;
    Node := RootFolder.Add(MetabaseUpdateNodeType.Object) 
As IMetabaseUpdateObjectNode;
    Node.UpdatePart := MetabaseObjectUpdatePart.DataMetadataSD;
    Node.UpdateType := MetabaseObjectUpdateType.Simple;
    Node.IncludeChildrenDependencies := TriState.OnOption;
    Node.Object := Mb.ItemById(
"Assembly_1").Bind;
    MUpdate.SaveToFileNF(
"C:\Update_1.pefx");
End Sub UserProc;

Public Shared Sub Main(Params: StartParams);
Var
    Mb: IMetabase;
    MUpdate: IMetabaseUpdate;
    RootFolder: IMetabaseUpdateFolderNode;
    Node: IMetabaseUpdateObjectNode;
Begin
    Mb := Params.Metabase;
    MUpdate := Mb.CreateUpdate();
    RootFolder := MUpdate.RootFolder;
    Node := RootFolder.Add(MetabaseUpdateNodeType.untObject) 
As IMetabaseUpdateObjectNode;
    Node.UpdatePart := MetabaseObjectUpdatePart.moupDataMetadataSD;
    Node.UpdateType := MetabaseObjectUpdateType.moutSimple;
    Node.IncludeChildrenDependencies := TriState.tsOnOption;
    Node.Object := Mb.ItemById[
"Assembly_1"].Bind();
    MUpdate.SaveToFileNF(
"C:\Update_1.pefx");
End Sub;

After executing of the example in the root of the C drive the new update file with the C:\Update_1.pefx name will be created. This file contains the Assembly_1 assembly with all its child objects.

See also:

IMetabase