Gradient : API Documentation

Type ContextManagerExtensions

Namespace LostTech.Gradient

Extensions, that enable using statement-like behavior

Methods

Public static methods

IDisposable StartUsing<T>(this IContextManager<T> contextManager)

Enters the scope of the context manager. Returns an IDisposable , whose Dispose method will exit the scope.
Show Example
using(new variable_scope("myvar").StartUsing()) DoStuff() 

void Use<T>(this IContextManager<T> contextManager, Action<T> action)

Perform an action in this context.

void Use<CM, T>(this CM contextManager, Action<CM, T> action)

Perform an action in this context.

TResult UseIn<T, TResult>(this IContextManager<T> contextManager, Func<T, TResult> func)

Compute a function in this context.

TResult UseIn<CM, T, TResult>(this CM contextManager, Func<CM, T, TResult> func)

Compute a function in this context.

void UseSelf<CM, T>(this CM contextManager, Action<CM> action)

Perform an action in this context.