Ejemplo n.º 1
0
        private IFlowScope OpenScope <T>(Id id)
        {
            var type = Runtime.GetRequest(typeof(T));

            IFlowScope scope;

            Expect(
                _scope.TryOpenFlowScope(type, new TimelineRoute(id), out scope),
                Text.Of("Failed to open scope for request \"{0}\" of type {1}", id, type));

            return(scope);
        }
Ejemplo n.º 2
0
        private bool TryOpenScope(TimelineRoute route, out IFlowScope scope)
        {
            scope = null;

            if (_timeline.TryOpenFlowScope(_flow, route, out scope))
            {
                var connection = scope.Connect(this);

                _scopesById[route.Id] = scope;

                RemoveWhenDone(scope, connection);
            }

            return(scope != null);
        }