示例#1
0
 public FlowScope(ILifetimeScope lifetime, IFlowDb db, FlowType type, TimelineRoute route)
 {
     _lifetime = lifetime;
     _db       = db;
     _type     = type;
     _route    = route;
     Key       = type.CreateKey(route.Id);
 }
示例#2
0
        internal bool TryRoute()
        {
            var route = _route;

            _route = null;

            return(_db.TryReadFlow(_type, route, out _flow));
        }
示例#3
0
        public bool TryOpenFlowScope(FlowType type, TimelineRoute route, out IFlowScope scope)
        {
            var unroutedScope = new FlowScope(_lifetime, _flowDb, type, route);

            scope = unroutedScope.TryRoute() ? unroutedScope : null;

            return(scope != null);
        }
示例#4
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);
        }
示例#5
0
 private bool TryGetScope(TimelineRoute route, out IFlowScope scope)
 {
     return(_scopesById.TryGetValue(route.Id, out scope));
 }