private static void OnScopeEnding(object sender, LifetimeScopeEndingEventArgs evt)
    {
        var map = default(ConcurrentDictionary <Type, object>);

        if (_factories.TryRemove(evt.LifetimeScope.ComponentRegistry, out map))
        {
            map.Clear();
        }
    }
Пример #2
0
 private static void SetupContainerOnCurrentScopeEnding(
     object sender
     , LifetimeScopeEndingEventArgs e
     )
 {
     Logger.Info(
         $"{nameof ( SetupContainerOnCurrentScopeEnding )} {e.LifetimeScope.Tag}"
         );
     CurrentLifetimeScope = null;
 }
Пример #3
0
        static void OnScopeEnding(object item, LifetimeScopeEndingEventArgs args)
        {
            args.LifetimeScope.CurrentScopeEnding -= OnScopeEnding;

            var context = ExecutionContext.Capture();

            if (!ExecutingScopes.ContainsKey(context))
            {
                return;
            }

            ExecutingScopes.Remove(context);
        }
Пример #4
0
        private void OnScopeEnding(object sender, LifetimeScopeEndingEventArgs args)
        {
            bool isWeb = System.Web.HttpContext.Current != null;

            Debug.WriteLine("Scope END, Web: " + isWeb);
        }
Пример #5
0
 /// <summary>
 /// Bu event in fire olmasi icin asagidaki gibi bir kullanim olmasi lazim
 ///     using (EngineContext.Current.ContainerManager.Scope())
 ///     {
 ///        var sampleResolve = EngineContext.Current.Resolve<SomeComponent>();
 ///     }
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void Value_CurrentScopeEnding(object sender, LifetimeScopeEndingEventArgs e)
 {
     //burada hashtable uretildigini bildigimiz icin null ataması yapiyoruz ki sonradan yeni thread geldiğinde tekrar uretilsin.
     HybridContext.Current[typeof(ILifetimeScope)] = null;
 }
 private static void LifetimeScopeEnding(object sender, LifetimeScopeEndingEventArgs e)
 {
     e.LifetimeScope.ResolveOperationBeginning -= ResolveOperationBeginning;
     e.LifetimeScope.ChildLifetimeScopeBeginning -= LifetimeScopeBeginning;
     e.LifetimeScope.CurrentScopeEnding -= LifetimeScopeEnding;
 }
Пример #7
0
 private void Scope_CurrentScopeEnding(object sender, LifetimeScopeEndingEventArgs e)
 {
     _listViewDataSource?.ForEach(x => x.PageData = null);
     _listViewDataSource?.Clear();
     GC.Collect();
 }
 private void OnCurrentScopeEnding(object sender, LifetimeScopeEndingEventArgs e)
 {
     CurrentScopeEnding?.Invoke(sender, e);
 }
Пример #9
0
 private void OnCurrentScopeEnding(LifetimeScopeEndingEventArgs e)
 {
     CurrentScopeEnding?.Invoke(this, e);
 }
Пример #10
0
 private static void LifetimeScopeEnding(object sender, LifetimeScopeEndingEventArgs e)
 {
     e.LifetimeScope.ResolveOperationBeginning   -= ResolveOperationBeginning;
     e.LifetimeScope.ChildLifetimeScopeBeginning -= LifetimeScopeBeginning;
     e.LifetimeScope.CurrentScopeEnding          -= LifetimeScopeEnding;
 }
 private void OnCurrentScopeEnding(LifetimeScopeEndingEventArgs e)
 {
     CurrentScopeEnding?.Invoke(this, e);
 }
 private void OnScopeEnding(object sender, LifetimeScopeEndingEventArgs args)
 {
     _contextState.Remove();
 }