Class Scope
Helper class to be used in the context of 'using' clause to
facilitate cleanup on scope exit and performing of other functions
such as status logging
Inheritance
System.Object
Scope
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: NFX
Assembly: NFX.dll
Syntax
public class Scope : DisposableObject, IDisposable
Constructors
Scope(String, Boolean, String, String, Nullable<MessageType>, Action, Boolean, Int32)
Declaration
public Scope(string name = null, bool log = false, string logText = null, string logTopic = null, MessageType? logMsgType = default (MessageType? ), Action onExit = null, bool measureTime = false, int stackFrameOffset = 2)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
| System.Boolean |
log |
|
| System.String |
logText |
|
| System.String |
logTopic |
|
| System.Nullable<MessageType> |
logMsgType |
|
| System.Action |
onExit |
|
| System.Boolean |
measureTime |
|
| System.Int32 |
stackFrameOffset |
|
Methods
AtExit(Action)
Declaration
public Scope AtExit(Action onExit)
Parameters
| Type |
Name |
Description |
| System.Action |
onExit |
|
Returns
AtExit<T1>(T1, Action<T1>)
Declaration
public Scope AtExit<T1>(T1 c1, Action<T1> onExit)
Parameters
| Type |
Name |
Description |
| T1 |
c1 |
|
| System.Action<T1> |
onExit |
|
Returns
Type Parameters
AtExit<T1, T2>(T1, T2, Action<T1, T2>)
Declaration
public Scope AtExit<T1, T2>(T1 c1, T2 c2, Action<T1, T2> onExit)
Parameters
| Type |
Name |
Description |
| T1 |
c1 |
|
| T2 |
c2 |
|
| System.Action<T1, T2> |
onExit |
|
Returns
Type Parameters
AtExit<T1, T2, T3>(T1, T2, T3, Action<T1, T2, T3>)
Declaration
public Scope AtExit<T1, T2, T3>(T1 c1, T2 c2, T3 c3, Action<T1, T2, T3> onExit)
Parameters
| Type |
Name |
Description |
| T1 |
c1 |
|
| T2 |
c2 |
|
| T3 |
c3 |
|
| System.Action<T1, T2, T3> |
onExit |
|
Returns
Type Parameters
| Name |
Description |
| T1 |
|
| T2 |
|
| T3 |
|
AtExit<T1, T2, T3, T4>(T1, T2, T3, T4, Action<T1, T2, T3, T4>)
Declaration
public Scope AtExit<T1, T2, T3, T4>(T1 c1, T2 c2, T3 c3, T4 c4, Action<T1, T2, T3, T4> onExit)
Parameters
| Type |
Name |
Description |
| T1 |
c1 |
|
| T2 |
c2 |
|
| T3 |
c3 |
|
| T4 |
c4 |
|
| System.Action<T1, T2, T3, T4> |
onExit |
|
Returns
Type Parameters
| Name |
Description |
| T1 |
|
| T2 |
|
| T3 |
|
| T4 |
|
Destructor()
Declaration
protected override void Destructor()
Overrides
OnExit(Action)
Declaration
public static Scope._scopeExit OnExit(Action onExit)
Parameters
| Type |
Name |
Description |
| System.Action |
onExit |
|
Returns
OnExit<T1>(T1, Action<T1>)
Declaration
public static Scope._scopeExit<T1> OnExit<T1>(T1 context, Action<T1> onExit)
Parameters
| Type |
Name |
Description |
| T1 |
context |
|
| System.Action<T1> |
onExit |
|
Returns
Type Parameters
OnExit<T1, T2>(T1, T2, Action<T1, T2>)
Declaration
public static Scope._scopeExit<T1, T2> OnExit<T1, T2>(T1 ctx1, T2 ctx2, Action<T1, T2> onExit)
Parameters
| Type |
Name |
Description |
| T1 |
ctx1 |
|
| T2 |
ctx2 |
|
| System.Action<T1, T2> |
onExit |
|
Returns
Type Parameters
OnExit<T1, T2, T3>(T1, T2, T3, Action<T1, T2, T3>)
Declaration
public static Scope._scopeExit<T1, T2, T3> OnExit<T1, T2, T3>(T1 ctx1, T2 ctx2, T3 ctx3, Action<T1, T2, T3> onExit)
Parameters
| Type |
Name |
Description |
| T1 |
ctx1 |
|
| T2 |
ctx2 |
|
| T3 |
ctx3 |
|
| System.Action<T1, T2, T3> |
onExit |
|
Returns
Type Parameters
| Name |
Description |
| T1 |
|
| T2 |
|
| T3 |
|
OnExit<T1, T2, T3, T4>(T1, T2, T3, T4, Action<T1, T2, T3, T4>)
Declaration
public static Scope._scopeExit<T1, T2, T3, T4> OnExit<T1, T2, T3, T4>(T1 c1, T2 c2, T3 c3, T4 c4, Action<T1, T2, T3, T4> onExit)
Parameters
| Type |
Name |
Description |
| T1 |
c1 |
|
| T2 |
c2 |
|
| T3 |
c3 |
|
| T4 |
c4 |
|
| System.Action<T1, T2, T3, T4> |
onExit |
|
Returns
Type Parameters
| Name |
Description |
| T1 |
|
| T2 |
|
| T3 |
|
| T4 |
|
Implements
System.IDisposable
Extension Methods