Exemplo n.º 1
0
 public DriveController(IDriveRepository driveRepository,
                        IUserAccountRepository userAccountRepository,
                        IUserGroupRepository userGroupRepository,
                        IRouteFinder routeFinder,
                        IRouteParser routeParser)
 {
     _driveRepository       = driveRepository;
     _userAccountRepository = userAccountRepository;
     _userGroupRepository   = userGroupRepository;
     _routeFinder           = routeFinder;
     _routeParser           = routeParser;
 }
Exemplo n.º 2
0
 public RouteManager(IRouteParser RouteParser, IResponseSerializer Serializer)
 {
     if (RouteParser == null)
     {
         throw new ArgumentNullException(nameof(RouteParser));
     }
     if (Serializer == null)
     {
         throw new ArgumentNullException(nameof(Serializer));
     }
     this.routeParser      = RouteParser;
     this.serializer       = Serializer;
     getRouteDictionary    = new Dictionary <string, RouteBinding>();
     putRouteDictionary    = new Dictionary <string, RouteBinding>();
     postRouteDictionary   = new Dictionary <string, RouteBinding>();
     deleteRouteDictionary = new Dictionary <string, RouteBinding>();
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Route"/> class.
        /// </summary>
        /// <param name="routeSpecification">The path specification, which gives the pattern that paths will
        /// follow. For example, "/patients/{action}".</param>
        /// <param name="routeHandler">A delegate that will produce a route handler when needed for this
        /// route.</param>
        /// <param name="defaults">The default values of this route.</param>
        /// <param name="constraints">The constraints that will apply to this route.</param>
        /// <param name="parser">An object charged with parsing the route specification, producing a
        /// <see cref="ParsedRoute"/>.</param>
        /// <param name="validator">An object charged with validating the route configuration, ensuring the
        /// route doesn't violate any expectations around how a route can be declared.</param>
        public Route(string routeSpecification, Func <IRouteHandler> routeHandler, RouteValueDictionary defaults, RouteValueDictionary constraints, IRouteParser parser, IRouteValidator validator)
        {
            Guard.ArgumentNotNull(routeHandler, "routeHandler");

            pathSpecification = routeSpecification ?? string.Empty;
            this.routeHandler = routeHandler;

            this.validator   = validator ?? new RouteValidator();
            this.defaults    = defaults ?? new RouteValueDictionary();
            this.constraints = constraints ?? new RouteValueDictionary();

            this.parser = parser ?? new RouteParser(
                new ParameterSegmentRecognizer(),
                new LiteralSegmentRecognizer(),
                new CatchAllParameterSegmentRecognizer()
                );
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Route"/> class.
        /// </summary>
        /// <param name="routeSpecification">The path specification, which gives the pattern that paths will
        /// follow. For example, "/patients/{action}".</param>
        /// <param name="routeHandler">A delegate that will produce a route handler when needed for this
        /// route.</param>
        /// <param name="defaults">The default values of this route.</param>
        /// <param name="constraints">The constraints that will apply to this route.</param>
        /// <param name="parser">An object charged with parsing the route specification, producing a
        /// <see cref="ParsedRoute"/>.</param>
        /// <param name="validator">An object charged with validating the route configuration, ensuring the
        /// route doesn't violate any expectations around how a route can be declared.</param>
        public Route(string routeSpecification, Func<IRouteHandler> routeHandler, RouteValueDictionary defaults, RouteValueDictionary constraints, IRouteParser parser, IRouteValidator validator)
        {
            Guard.ArgumentNotNull(routeHandler, "routeHandler");

            pathSpecification = routeSpecification ?? string.Empty;
            this.routeHandler = routeHandler;

            this.validator = validator ?? new RouteValidator();
            this.defaults = defaults ?? new RouteValueDictionary();
            this.constraints = constraints ?? new RouteValueDictionary();
            
            this.parser = parser ?? new RouteParser(
                new ParameterSegmentRecognizer(),
                new LiteralSegmentRecognizer(),
                new CatchAllParameterSegmentRecognizer()
                );
        }
Exemplo n.º 5
0
 protected override void Establish()
 {
     _routeText   = null;
     _routeParser = RouteParserBuilder.Build();
     _route       = null;
 }
 protected override void Establish()
 {
     _routeText   = "LRMRLMMRMLM";
     _routeParser = RouteParserBuilder.Build();
 }
Exemplo n.º 7
0
 public MemoizedRouteParser(IRouteParser innerParser)
 {
     _innerParser = innerParser;
 }
Exemplo n.º 8
0
 protected override void Establish()
 {
     _routeText   = "XYZABC123";
     _routeParser = RouteParserBuilder.Build();
 }
 protected override void Establish()
 {
     _routeText   = "UDM";
     _routeParser = RouteParserBuilder.Build(new UpDownRouteStepResolver(), new MoveOneGridSpaceRouteStepResolver());
     _route       = null;
 }
Exemplo n.º 10
0
 public MemoizedRouteParser(IRouteParser innerParser)
 {
     _innerParser = innerParser;
 }
Exemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Route"/> class.
 /// </summary>
 /// <param name="routeSpecification">The path specification, which gives the pattern that paths will
 /// follow. For example, "/patients/{action}".</param>
 /// <param name="routeHandler">A delegate that will produce a route handler when needed for this
 /// route.</param>
 /// <param name="defaults">The default values of this route.</param>
 /// <param name="constraints">The constraints that will apply to this route.</param>
 /// <param name="parser">An object charged with parsing the route specification, producing a
 /// <see cref="ParsedRoute"/>.</param>
 public Route(string routeSpecification, Func <IRouteHandler> routeHandler, RouteValueDictionary defaults, RouteValueDictionary constraints, IRouteParser parser)
     : this(routeSpecification, routeHandler, defaults, constraints, parser, null)
 {
 }
Exemplo n.º 12
0
 public CommandController(ILogger <CommandController> logger, IRouteParser routeParser, IInterpretersManager interpretersManager)
 {
     this.logger = logger;
     this.interpretersManager = interpretersManager;
     this.routeParser         = routeParser;
 }
Exemplo n.º 13
0
 public RobotParser(IPositionParser positionParser, IRouteParser routeParser)
 {
     _positionParser = positionParser;
     _routeParser    = routeParser;
 }
Exemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Route"/> class.
 /// </summary>
 /// <param name="routeSpecification">The path specification, which gives the pattern that paths will
 /// follow. For example, "/patients/{action}".</param>
 /// <param name="routeHandler">A delegate that will produce a route handler when needed for this
 /// route.</param>
 /// <param name="defaults">The default values of this route.</param>
 /// <param name="constraints">The constraints that will apply to this route.</param>
 /// <param name="parser">An object charged with parsing the route specification, producing a
 /// <see cref="ParsedRoute"/>.</param>
 public Route(string routeSpecification, Func<IRouteHandler> routeHandler, RouteValueDictionary defaults, RouteValueDictionary constraints, IRouteParser parser)
     : this(routeSpecification, routeHandler, defaults, constraints, parser, null)
 {
 }