private static void OnScopeEnding(object sender, LifetimeScopeEndingEventArgs evt) { var map = default(ConcurrentDictionary <Type, object>); if (_factories.TryRemove(evt.LifetimeScope.ComponentRegistry, out map)) { map.Clear(); } }
private static void SetupContainerOnCurrentScopeEnding( object sender , LifetimeScopeEndingEventArgs e ) { Logger.Info( $"{nameof ( SetupContainerOnCurrentScopeEnding )} {e.LifetimeScope.Tag}" ); CurrentLifetimeScope = null; }
static void OnScopeEnding(object item, LifetimeScopeEndingEventArgs args) { args.LifetimeScope.CurrentScopeEnding -= OnScopeEnding; var context = ExecutionContext.Capture(); if (!ExecutingScopes.ContainsKey(context)) { return; } ExecutingScopes.Remove(context); }
private void OnScopeEnding(object sender, LifetimeScopeEndingEventArgs args) { bool isWeb = System.Web.HttpContext.Current != null; Debug.WriteLine("Scope END, Web: " + isWeb); }
/// <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; }
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); }
private void OnCurrentScopeEnding(LifetimeScopeEndingEventArgs e) { CurrentScopeEnding?.Invoke(this, e); }
private void OnScopeEnding(object sender, LifetimeScopeEndingEventArgs args) { _contextState.Remove(); }