IMetabaseObjectDescriptor.EditTemporary

Syntax

EditTemporary: IMetabaseObject;

Description

The EditTemporary method opens the object for temporary change of properties.

Comments

The object can not be used in this mode. The "Object is not in the state of editing" error is generated during the saving.

Example

Executing the example requires a form, a button positioned on it with the Button1 identifier, the ModelBox component and the UiModel component with the UiModel1 identifier that is the data source for ModelBox. The repository contains a modeling container with the CONT_MODEL identifier and a model created in it with the MODEL identifier.

Add links to the Metabase, Ms system assemblies.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    MB: IMetabase;
    ContKey: Integer;
    Model: IMsModel;
Begin
    MB := MetabaseClass.Active;
    ContKey := MB.ItemById(
"CONT_MODEL").Key;
    Model := MB.ItemByIdNamespace(
"MODEL", ContKey).EditTemporary As IMsModel;
    UiModel1.Active := 
False;
    UiModel1.Model := Model;
    UiModel1.Active := 
True;
End Sub Button1OnClick;

The MODEL model is opened in the ModelBox component after executing this example. Parameters of the model can be edited but they can not be saved.

See also:

IMetabaseObjectDescriptor