CreateExecutionContext: IUiCommandExecutionContext;
The CreateExecutionContext method creates a command execution context. Execution context is required to determine the environment, in which the command is executed: parent window (form), execution mode and parameters.
Executing the example requires a form and a button named Button1 on the form.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Mb: IMetabase;
MbSec: IMetabaseSecurity;
User: IMetabaseUser;
Target: IUiCommandTarget;
Context: IUiCommandExecutionContext;
Begin
MB := MetabaseClass.Active;
MbSec := MB.Security;
User := MB.LogonSession.User;
Target := WinApplication.Instance.GetPluginTarget("Adm");
Context := Target.CreateExecutionContext;
Context.Data := User;
Target.Execute("ShowHoursPolicy", Context);
End Sub Button1OnClick;
Clicking the button opens a dialog box that is used to distribute time of system access for the user used for the current repository connection.
See also: