Пример #1
0
        public RouteResolverTrie(ITrieNodeFactory nodeFactory, IRouteCache cache)
        {
            _nodeFactory = nodeFactory;
            _routeTries  = new Dictionary <string, TrieNode>(StringComparer.OrdinalIgnoreCase);

            BuildTrie(cache);
        }
Пример #2
0
        protected TrieNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
        {
            Parent = parent;
            RouteDefinitionSegment = segment;
            _nodeFactory           = nodeFactory;

            NodeData = new List <NodeData>();
            Children = new Dictionary <string, TrieNode>(StringComparer.OrdinalIgnoreCase);
        }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TrieNode"/> class
        /// </summary>
        /// <param name="parent">Parent node</param>
        /// <param name="segment">Segment of the route definition</param>
        /// <param name="nodeFactory">Factory for creating new nodes</param>
        protected TrieNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
        {
            this.nodeFactory            = nodeFactory;
            this.Parent                 = parent;
            this.RouteDefinitionSegment = segment;

            this.Children             = new Dictionary <string, TrieNode>(StringComparer.OrdinalIgnoreCase);
            this.AdditionalParameters = new Dictionary <string, object>();
            this.NodeData             = new List <NodeData>();
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TrieNode"/> class
        /// </summary>
        /// <param name="parent">Parent node</param>
        /// <param name="segment">Segment of the route definition</param>
        /// <param name="nodeFactory">Factory for creating new nodes</param>
        protected TrieNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
        {
            this.nodeFactory = nodeFactory;
            this.Parent = parent;
            this.RouteDefinitionSegment = segment;

            this.Children = new Dictionary<string, TrieNode>();
            this.AdditionalParameters = new Dictionary<string, object>();
            this.NodeData = new List<NodeData>();
        }
Пример #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TrieNode"/> class
        /// </summary>
        /// <param name="parent">Parent node</param>
        /// <param name="segment">Segment of the route definition</param>
        /// <param name="nodeFactory">Factory for creating new nodes</param>
        protected TrieNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
        {
            this.nodeFactory = nodeFactory;
            this.Parent = parent;
            this.RouteDefinitionSegment = segment;

            this.Children = new Dictionary<string, TrieNode>(StaticConfiguration.CaseSensitive ? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase);
            this.AdditionalParameters = new Dictionary<string, object>();
            this.NodeData = new List<NodeData>();
        }
 public CaptureNodeWithConstraint(TrieNode parent, string segment, ITrieNodeFactory nodeFactory, IEnumerable<IRouteSegmentConstraint> routeSegmentConstraints)
     : base(parent, segment, nodeFactory)
 {
     this.routeSegmentConstraints = routeSegmentConstraints;
     this.ExtractParameterName();
 }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CaptureNodeWithConstraint"/> class, with
 /// the provided <paramref name="parent"/>, <paramref name="segment"/> and <paramref name="nodeFactory"/>.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="segment">The segment.</param>
 /// <param name="nodeFactory">The node factory.</param>
 /// <param name="routeSegmentConstraints">The route segment constraints.</param>
 public CaptureNodeWithConstraint(TrieNode parent, string segment, ITrieNodeFactory nodeFactory, IEnumerable <IRouteSegmentConstraint> routeSegmentConstraints)
     : base(parent, segment, nodeFactory)
 {
     this.routeSegmentConstraints = routeSegmentConstraints;
     this.ExtractParameterName();
 }
Пример #8
0
 public RootNode(ITrieNodeFactory nodeFactory)
     : base(null, null, nodeFactory)
 {
 }
 public GreedyRegExCaptureNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.BuildRegEx();
 }
Пример #10
0
 public RouteResolverTrie(ITrieNodeFactory nodeFactory)
 {
     this.nodeFactory = nodeFactory;
 }
Пример #11
0
 public GreedyRegExCaptureNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.BuildRegEx();
 }
 public RegExNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.BuildRegEx();
 }
Пример #13
0
 public RootNode(ITrieNodeFactory nodeFactory)
     : base(null, null, nodeFactory)
 {
 }
 /// <summary>
 /// Captures parameters within segments that contain literals.
 ///     i.e:
 ///         /{file}.{name}
 ///         /{file}.html
 ///         /{major}.{minor}.{revision}B{build}
 /// </summary>
 /// <param name="parent">The parent node</param>
 /// <param name="segment">The segment to match upon</param>
 /// <param name="nodeFactory">The factory</param>
 public CaptureNodeWithMultipleParameters(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.ExtractParameterNames();
 }
 public CaptureNodeWithDefaultValue(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.ExtractParameterNameAndDefaultValue();
 }
 /// <summary>
 /// Captures parameters within segments that contain literals.
 ///     i.e:
 ///         /{file}.{name}
 ///         /{file}.html
 ///         /{major}.{minor}.{revision}B{build}
 /// </summary>
 /// <param name="parent">The parent node</param>
 /// <param name="segment">The segment to match upon</param>
 /// <param name="nodeFactory">The factory</param>
 public CaptureNodeWithMultipleParameters(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.ExtractParameterNames();
 }
Пример #17
0
 public RouteResolverTrie(ITrieNodeFactory nodeFactory)
 {
     this.nodeFactory = nodeFactory;
 }
 public CaptureNodeWithDefaultValue(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.ExtractParameterNameAndDefaultValue();
 }
Пример #19
0
 public RegExNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.BuildRegEx();
 }
Пример #20
0
 public CaptureNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.ExtractParameterName();
 }
 public LiteralNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
 }
Пример #22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LiteralNode"/> class with
 /// the provided <paramref name="parent"/>, <paramref name="segment"/> and <paramref name="nodeFactory"/>.
 /// </summary>
 /// <param name="parent">Parent node</param>
 /// <param name="segment">Segment of the route definition</param>
 /// <param name="nodeFactory">Factory for creating new nodes</param>
 public LiteralNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
 }
Пример #23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CaptureNode"/> class, with
 /// the provided <paramref name="parent"/>, <paramref name="segment"/> and <paramref name="nodeFactory"/>.
 /// </summary>
 /// <param name="parent">Parent node</param>
 /// <param name="segment">Segment of the route definition</param>
 /// <param name="nodeFactory">Factory for creating new nodes</param>
 public CaptureNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.ExtractParameterName();
 }
Пример #24
0
 public CaptureNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory) : base(parent, segment,
                                                                                          nodeFactory)
 {
     _parameterName = RouteDefinitionSegment.Trim('{', '}');
 }