Mode: ApplicationMode;
Mode: Prognoz.Platform.Interop.ForeSystem.ApplicationMode;
The Mode property determines by which method the connection to the repository was established.
The repository connection can be established from the client workstation of Prognoz Platform 9 or from the web application.
Executing the example requires a form containing the Button component with the Button1 identifier. This example is a handler of the OnClick event for the Button1 component.
Add links to the Ui, ForeSystem system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
Begin
MB := MetabaseClass.Active;
If MB.Mode = ApplicationMode.Web Then
WinApplication.InformationBox(This function is not available in the Web application);
Else
WinApplication.InformationBox(This function is available on connecting to the repository of Prognoz Platform client workstation.);
End If;
End Sub Button1OnClick;
As a result of the execution of the example the following message is displayed:
"This function is not available in the web application" if the connection to the repository is established from the web application.
"This function is available on connecting to the repository from the client workstation of Prognoz Platform 9, if the repository connection was established from the client workstation of Prognoz Platform 9.
Executing the example requires a form containing the Button component with the Button1 identifier. This example processes the Click event for button1.
Add links to the Ui, ForeSystem system assemblies.
Imports Prognoz.Platform.Interop.Ui;
Imports Prognoz.Platform.Interop.ForeSystem;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
MB: IMetabase;
WinApp: WinApplicationClassClass = New WinApplicationClassClass();
Begin
MB := Self.Metabase;
If MB.Mode = ApplicationMode.amWeb Then
WinApp.InformationBox(This function is not available in the Web application., New IWin32WindowForeAdapter(Self));
Else
WinApp.InformationBox(This function is available on connecting to the repository of Prognoz Platform client workstation., New IWin32WindowForeAdapter(Self));
End If;
End Sub;
The result of the Fore.NET Example execution matches with that inn the Fore Example.
See also: