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.
- C#
- VB.NET
public class SalContext : IDisposable
Public Class SalContext
Inherits 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
SalContext(ctrl)
Establishes a nested SAL context for a control.
| Name | Type | Description |
|---|---|---|
| ctrl | Control | The target control; null pushes an empty window context. |
SalContext(ctrl, root)
Establishes a control context with an explicit root-dispatch flag.
| Name | Type | Description |
|---|---|---|
| ctrl | Control | The target control; null pushes an empty window context. |
| root | Boolean | True for a new message-dispatch root; false for a nested context that may preserve the originating item. |
SalContext(ctrl, locals)
Establishes a nested control context and SQL binding scope with local variables.
| Name | Type | Description |
|---|---|---|
| ctrl | Control | The target control; null pushes an empty window context. |
| locals | Object | The object that exposes local variables for SQL binding. |
SalContext(module)
Pushes a module context with empty SAL window handles.
| Name | Type | Description |
|---|---|---|
| module | Assembly | The assembly to use as the current application module. |
Throws:
- ArgumentNullException module is null.
Properties
Control
Control: Gets the target control retained by this context, or null for an empty, module-only, or disposed context.
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.
Disposed
Boolean: Gets whether this context has already been disposed.
Module
Assembly: Gets the application assembly associated with this context.
Methods
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:
- InvalidOperationException This instance has already been disposed.