Пример #1
0
        public void Destroy()
        {
            if (IsDestroyed)
            {
                return;
            }
            if (_isGlobal)
            {
                ContextRegistry.UnregisterContext(_name);
            }

            DisposeDependencies();

#if BINJECT_DIAGNOSTICS
            BinjectDiagnostics.DependenciesCount -= _listedDependencies.Count;
            BinjectDiagnostics.RecipientCount    -= _listedDependencies.Count;
            BinjectDiagnostics.CommandsCount     -= _commands.Count;
#endif

            _parentContext.OnContextDestroyed -= HandleParentDestroyed;
            EventManager.ClearParent();
            EventManager.RemoveTransmitter(this);

            if (OnContextDestroyed != null)
            {
                OnContextDestroyed();
            }

            IsDestroyed = true;
        }
Пример #2
0
 public void Destroy()
 {
     EventManager.ClearParent();
     ContextRegistry.UnregisterContext(_name);
 }