Skip to main content

SalContext

Namespace: PPJ.Runtime.Windows

Assembly: PPJ.Runtime.50 (5.0.0.0)

Scopes the SAL window system variables and SQL binding context to a control on the current thread.

public class SalContext : IDisposable

Dispose nested contexts in reverse creation order on the same thread. A null control pushes an empty window context. A control without a created handle does not switch the window context, but still establishes the associated SQL context.

Example:

void RunInContext(System.Windows.Forms.Control control)
{
using (new PPJ.Runtime.Windows.SalContext(control))
{
System.Diagnostics.Debug.WriteLine(PPJ.Runtime.Sys.hWndItem);
}
// The previous window context has been restored.
}

Constructors

Instance member SalContext(ctrl)

Enters a non-root SAL context for the specified control.

NameTypeDescription
ctrlControlThe target control, or null to enter an empty window context.

Instance member SalContext(ctrl, root)

Enters a SAL context with an explicit message-dispatch root setting.

NameTypeDescription
ctrlControlThe target control, or null to enter an empty window context.
rootBooleanTrue to establish a root message-dispatch context; false for a nested context.

Instance member SalContext(ctrl, locals)

Enters a non-root SAL context with local variables available for SQL binding.

NameTypeDescription
ctrlControlThe target control, or null to enter an empty window context.
localsObjectThe object exposing local SQL bind variables.

Properties

Instance member Disposed

Boolean: Gets whether this context has already been disposed.

Methods

Instance member Dispose()

Restores the previous window context and disposes the associated SQL context.

Throws: