コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
            }
        }