Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Public fields | Public Member Functions | List of all members
Loyc.Threading.AmbientService< T >.Saved Struct Reference

Returned by Set; restores the previous ambient override (if any) when disposed. More...


Source file:
Inheritance diagram for Loyc.Threading.AmbientService< T >.Saved:
Loyc.Threading.AmbientService< T >

Remarks

Returned by Set; restores the previous ambient override (if any) when disposed.

Public fields

AmbientService< T > _owner
 
_oldValue
 
- Public fields inherited from Loyc.Threading.AmbientService< T >
Value => _overrideCount == 0 ? _globalDefault : _override.Value ?? _globalDefault
 Gets the current T instance (the current async execution context's override if one is active, otherwise GlobalDefault. More...
 

Public Member Functions

void Dispose ()
 
- Public Member Functions inherited from Loyc.Threading.AmbientService< T >
 AmbientService (T globalDefault)
 
Saved Set (T newValue)
 Installs an ambient (async-local) override. Designed to be used in a using statement, which restores the old value at the end. More...
 

Additional Inherited Members

- Properties inherited from Loyc.Threading.AmbientService< T >
GlobalDefault [get, set]
 The instance used by every execution context that has no ambient override from Set. It can be replaced app-wide. More...