Skip to main content
Version: 2023

SalApplication

Namespace: PPJ.Runtime.Windows

Assembly: PPJ.Web.49 (4.9.0.0)

Base class for SAL applications.

public class SalApplication

Constructors

Instance memberSalApplication()

Properties

Static memberApplicationType

Type: Returns the type of the application.

Static memberCompanyName

String: Returns the company of the application loaded from the AssemblyCompany attribute;

Static memberDefaultPrinterSettings

PrinterSettings: Returns the default printer settings. This is set by SalPrt

Static memberInstance

SalApplication: Singleton instance of the SalApplication object. When this is the main SalApplication object, the instance is created as the startup form. References assemblies, instead, create their session instance of the SalApplication object upon accessing the Instance singleton property.

Applications can have multiple instances of the SalApplication object, one for each ported assembly. Each SalApplication class belongs necessarily to a different namespace.

Static memberTitle

String: Returns the title of the application loaded from the AssemblyTitle attribute;

Static memberTopLevelForms

Form[]: Returns a list of all top-level forms that belong to this application.

Static memberVersion

Int32: Returns the version of the framework.

Methods

Static memberAddForm(form)

Increase the reference count for the application object. It is called every time a new SalForm is created.

ParameterTypeDescription
formForm

Returns: Int32. Updated reference count

Static memberDisable()

Disables input to all open forms. Use SalAppDisable and SalAppEnable when there are multiple applications running simultaneously and you want to control which application receives user input.

Returns: Boolean. bOk

Static memberEnable()

Enables input to all open forms that were disabled by SalAppDisable. Use SalAppDisable and SalAppEnable when there are multiple applications running simultaneously and you want to control which application receives user input.

Returns: Boolean. bOk

Static memberEndTrace()

Stops all tracing. Any calls to SalTrace() occurring after SalEndTrace() will be ignored.

Returns: Boolean.

Static memberGetProfileInt(section, entry, defaultValue, fileName)

Retrieves the integer value of an entry in the specified section of an initialization file or registry.

ParameterTypeDescription
sectionString
entryString
defaultValueUInt32
fileNameString

Returns: UInt32.

Static memberGetProfileString(section, entry, defaultValue, value, fileName)

ParameterTypeDescription
sectionString
entryString
defaultValueString
valueSalString&
fileNameString

Returns: Int32.

Static memberInvokeScript(script)

Executes javascript on the client.

ParameterTypeDescription
scriptString

Static memberLoadApp(name, args)

Starts an application.

ParameterTypeDescription
nameString
argsString

Returns: Boolean.

Static memberLoadAppAndWait(name, mode, retCode)

ParameterTypeDescription
nameString
modeInt32
retCodeSalNumber&

Returns: Boolean.

Instance memberQuit()

Forces the termination of the application.

Static memberRefresh()

Forces the browser to reload the document. It's necessary when changing the Mdi tabbed layout and may come handy for other live changes.

Static memberRemoveForm(form)

Decreases the reference count for the application object. When the count drops to zero (or below if there is a bug), the application exits. It is called every time a Sal form is destroyed. This should emulate SAL application's behavior with respect to top level windows. When the last form is destroyed the app exits.

ParameterTypeDescription
formForm

Returns: Int32.

Instance memberRun(args)

Main method to startup a SAL application.

ParameterTypeDescription
argsNameValueCollection

Returns: Int32.

The SAL application class that extends SalApplication should call this method in the application's Main form OnLoad() method.


public class MainForm : Form
{
protected override void OnLoad(EventArgs e)
{
new App().Run();
}
}

Static memberSetProfileString(section, entry, value, fileName)

Set the value of an entry in the specified section of an initialization file or registry. All profile information is stored as string, so if you want to store an integer it must be converted to a string first. Then it can be retrieved as an integer using the SalGetProfileInt- Function .

ParameterTypeDescription
sectionStringThe section heading.
entryStringThe entry whose associated value is being set.
valueStringThe value of sEntry.
fileNameStringThe name of the initialization file or company name depending on the settings made using the SalUseRegistry function. If you are searching for an INI file and do not specify the full path, searches for the file in the Windows subdirectory.

Returns: Boolean. bOk

Static memberStartTrace(outputType, traceFile, clear)

Allows tracing to begin.

ParameterTypeDescription
outputTypeInt32
traceFileString
clearBoolean

Returns: Boolean.

Static memberTrace(severity, text)

Outputs a string to the trace output target selected earlier in the SalStartTrace function. Note that if tracing is not already activated, this function will return TRUE even though no trace action is taken. When writing to the event log, the severity level is kept in numeric form. When writing to any other output target, it is translated into a text string such as "Warning".

ParameterTypeDescription
severityInt32
textString

Returns: Boolean.

Static memberUseEventLog(useLog, logAndcontinue)

Enables logging of unhandled exceptions in the event log.

ParameterTypeDescription
useLogBoolean
logAndcontinueBoolean

Returns: Boolean.

Static memberUseRegistry(useRegistry, companyName)

This function is used to re-direct all SalProfile* functions to use the Registry. All values for the SalProfile* functions are saved as strings. The INI file name used as the last parameter of the SalProfile* functions will be used as the application name. The resulting path will be: \HKEY_CURRENT_USER\Software[company name][application name][section][setting]\

ParameterTypeDescription
useRegistryBoolean
companyNameString

Returns: Boolean. bOk