EditCustomClass Command

Purpose

It opens a dialog box for editing the existing custom class.

Application Features

If the existing custom class is edited successfully, the Execute method returns True, otherwise it returns False.

Example

Executing the example requires that custom metadata contains the repository of custom class with the CUSTOMCLASS identifier.

Add links to the Metabase, Ui system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
    CustomExtender: IMetabaseCustomExtender;
    Type: MetabaseSpecialObject;
    Result: Boolean;
    Data: Array 
Of Variant;
Begin
    Mb := MetabaseClass.Active;
    Type := MetabaseSpecialObject.CustomExtender;
    Target := WinApplication.Instance.GetPluginTarget(
"Std");
    Context := Target.CreateExecutionContext;
    Data := 
New Variant[2];
    CustomExtender := Mb.SpecialObject(Type).Bind 
As IMetabaseCustomExtender;
    Data[
0] := MetabaseClass.Active;
    Data[
1] := CustomExtender.Classes.FindById("CUSTOMCLASS").Key;
    Context.Data := Data;
    Result := Target.Execute(
"EditCustomClass", Context);
    Debug.WriteLine(Result);
End Sub UserProc;

After executing the example a dialog box opens to edit the custom class with the CUSTOMCLASS identifier. Change class parameters and click the OK button. The console displays the result of editing the class.

See also:

IUiCommandTarget.Execute