public void UpdateFrom(InstanceLookupEndingMessage e) { InstanceLookup instanceLookup; if (!_instanceLookups.TryGetItem(e.InstanceLookupId, out instanceLookup)) { throw new InvalidOperationException("Instance lookup ending is unknown."); } var popped = instanceLookup.ResolveOperation.InstanceLookupStack.Pop(); if (popped != instanceLookup) { throw new InvalidOperationException("Wrong instance lookup was on the top of the stack."); } popped.SharedInstanceReused = !e.NewInstanceActivated; if (popped.SharedInstanceReused) { _instanceLookups.RemoveCompleted(popped); } }
public void UpdateFrom(ResolveOperationEndingMessage message) { ResolveOperation resolveOperation; if (!_resolveOperations.TryGetItem(message.ResolveOperationId, out resolveOperation)) { throw new InvalidOperationException("Ending resolve operation is unknown."); } resolveOperation.Thread.ResolveOperationStack.Pop(); _resolveOperations.RemoveCompleted(resolveOperation); }
public void UpdateFrom(LifetimeScopeEndingMessage message) { LifetimeScope lifetimeScope; if (_lifetimeScopes.TryGetItem(message.LifetimeScopeId, out lifetimeScope)) { if (lifetimeScope.Parent != null) { lifetimeScope.Parent.ActiveChildren.Remove(lifetimeScope); } _lifetimeScopes.RemoveCompleted(lifetimeScope); } }