コード例 #1
0
    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;
 }
コード例 #6
0
 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();
 }
コード例 #8
0
 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;
 }
コード例 #11
0
 private void OnCurrentScopeEnding(LifetimeScopeEndingEventArgs e)
 {
     CurrentScopeEnding?.Invoke(this, e);
 }
コード例 #12
0
 private void OnScopeEnding(object sender, LifetimeScopeEndingEventArgs args)
 {
     _contextState.Remove();
 }