Skip to main content
Version: 2025

SalContext

Namespace: PPJ.Runtime.Windows

Assembly: PPJ.Web.50 (5.0.0.0)

Scopes the SAL item, form, MDI, and module context used while handling control actions.

public class SalContext : IDisposable

Control-based contexts also synchronize SQL binding context. Use nested using statements so contexts are disposed in reverse creation order. Disposal restores the preceding context and must occur only once per instance.

Example:

void RunInContext(Wisej.Web.Control control)
{
using (var context = new PPJ.Runtime.Windows.SalContext(control))
{
PPJ.Runtime.SalWindowHandle currentItem = PPJ.Runtime.Sys.hWndItem;
// Perform SAL operations that use the current window context.
}
}

Constructors

Instance member SalContext(ctrl)

Establishes a nested SAL context for a control.

NameTypeDescription
ctrlControlThe target control; null pushes an empty window context.

Instance member SalContext(ctrl, root)

Establishes a control context with an explicit root-dispatch flag.

NameTypeDescription
ctrlControlThe target control; null pushes an empty window context.
rootBooleanTrue for a new message-dispatch root; false for a nested context that may preserve the originating item.

Instance member SalContext(ctrl, locals)

Establishes a nested control context and SQL binding scope with local variables.

NameTypeDescription
ctrlControlThe target control; null pushes an empty window context.
localsObjectThe object that exposes local variables for SQL binding.

Instance member SalContext(module)

Pushes a module context with empty SAL window handles.

NameTypeDescription
moduleAssemblyThe assembly to use as the current application module.

Throws:

Properties

Instance member Control

Control: Gets the target control retained by this context, or null for an empty, module-only, or disposed context.

Static member Current

SalContext: Gets the context at the top of the current asynchronous execution flow's stack.

An empty baseline context is created when the stack has not yet been initialized.

Instance member Disposed

Boolean: Gets whether this context has already been disposed.

Instance member Module

Assembly: Gets the application assembly associated with this context.

Methods

Instance member Dispose()

Restores the preceding SAL context and disposes the associated SQL context.

Dispose contexts in reverse creation order. This method clears the retained target control. Throws: