The Mode property determines by which method the connection to the repository was established.
Connection to the repository can be established from the client workstation of Foresight Analytics Platform desktop or web application.
Executing the example on Fore requires a form containing the Button component with the Button1 identifier. This example is a handler of the OnClick event for the Button1 component.
Executing the example on Fore.NET requires a form containing the Button component with the Button1 identifier. This example processes the Click event for button1.
Add links to the ForeSystem, Metabase, Ui 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 repository connection from client workstation from Foresight Analytics Platform desktop application.");
End If;
End Sub Button1OnClick;
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 repository connection from client workstation from Foresight Analytics Platform desktop application".", New IWin32WindowForeAdapter(Self));
End If;
End Sub;
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 repository connection from client workstation from Foresight Analytics Platform desktop application if repository connection is established at client workstation from Foresight Analytics Platform desktop application.
See also: