protected NetCoreScope(NetCoreScope parent)
 {
     _parent     = parent;
     _scopeCache = new ScopeCache();
     Nesting     = (parent?.Nesting ?? 0) + 1;
     _rootScope  = _parent?.RootScope;
 }
예제 #2
0
 protected ExtensionContainerScope(ExtensionContainerScope parent)
 {
     scopeCache = new ScopeCache();
     if (parent == null)
     {
         this.parent = ExtensionContainerRootScope.RootScope;
     }
     else
     {
         this.parent = parent;
     }
 }
예제 #3
0
 /// <inheritdoc />
 public void Dispose()
 {
     lock (@lock)
     {
         if (scopeCache == null)
         {
             return;
         }
         if (scopeCache is IDisposable disposableCache)
         {
             disposableCache.Dispose();
         }
         scopeCache = null;
     }
 }
예제 #4
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     lock (_lock)
     {
         if (_scopeCache == null)
         {
             return;
         }
         var disposableCache = _scopeCache as IDisposable;
         if (disposableCache != null)
         {
             disposableCache.Dispose();
         }
         _scopeCache = null;
     }
 }
예제 #5
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     lock (_lock)
     {
         if (_scopeCache == null)
         {
             return;
         }
         var disposableCache = _scopeCache as IDisposable;
         if (disposableCache != null)
         {
             disposableCache.Dispose();
         }
         _scopeCache = null;
     }
 }
예제 #6
0
 /// <inheritdoc />
 public ThreadSafeDefaultLifetimeScope(IScopeCache scopeCache = null, Action <Burden> onAfterCreated = null)
 {
     this.scopeCache     = scopeCache ?? new ScopeCache();
     this.onAfterCreated = onAfterCreated ?? emptyOnAfterCreated;
 }
예제 #7
0
		public DefaultLifetimeScope(IScopeCache scopeCache = null, Action<Burden> onAfterCreated = null)
		{
			this.scopeCache = scopeCache ?? new ScopeCache();
			this.onAfterCreated = onAfterCreated ?? emptyOnAfterCreated;
		}
예제 #8
0
 protected ExtensionContainerScopeBase()
 {
     scopeCache = new ScopeCache();
 }
예제 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MessageLifetimeScope"/> class.
 /// </summary>
 /// <param name="scopeCache">The scope cache.</param>
 /// <param name="onAfterCreated">The on after created.</param>
 public MessageLifetimeScope(IScopeCache scopeCache = null, Action <Burden> onAfterCreated = null)
 {
     _scopeCache     = scopeCache ?? new ScopeCache();
     _onAfterCreated = onAfterCreated ?? EmptyOnAfterCreated;
 }
예제 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MessageLifetimeScope"/> class.
 /// </summary>
 /// <param name="scopeCache">The scope cache.</param>
 /// <param name="onAfterCreated">The on after created.</param>
 public MessageLifetimeScope(IScopeCache scopeCache = null, Action<Burden> onAfterCreated = null)
 {
     _scopeCache = scopeCache ?? new ScopeCache();
     _onAfterCreated = onAfterCreated ?? EmptyOnAfterCreated;
 }