Fix the build.
[castle.git] / MonoRail / Castle.MonoRail.Framework / Routing / RouteMatch.cs
blob4799627fd46f9a75865f564388fd9e6218e125ab
1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.MonoRail.Framework.Routing
17 using System;
18 using System.Collections.Generic;
20 /// <summary>
21 /// Pendent
22 /// </summary>
23 public class RouteMatch
25 private readonly Type controllerType;
26 private readonly string ruleName;
27 private readonly string action;
28 private readonly List<string> literals = new List<string>();
29 private readonly Dictionary<string, string> parameters = new Dictionary<string, string>();
31 /// <summary>
32 /// Initializes a new instance of the <see cref="RouteMatch"/> class.
33 /// </summary>
34 /// <param name="controllerType">Type of the controller.</param>
35 /// <param name="ruleName">Name of the rule.</param>
36 /// <param name="action">The action.</param>
37 public RouteMatch(Type controllerType, string ruleName, string action)
39 this.controllerType = controllerType;
40 this.ruleName = ruleName;
41 this.action = action;
44 /// <summary>
45 /// Gets the type of the controller.
46 /// </summary>
47 /// <value>The type of the controller.</value>
48 public Type ControllerType
50 get { return controllerType; }
53 /// <summary>
54 /// Gets the name of the rule.
55 /// </summary>
56 /// <value>The name of the rule.</value>
57 public string RuleName
59 get { return ruleName; }
62 /// <summary>
63 /// Gets the action.
64 /// </summary>
65 /// <value>The action.</value>
66 public string Action
68 get { return action; }
71 /// <summary>
72 /// Gets the literals.
73 /// </summary>
74 /// <value>The literals.</value>
75 public List<string> Literals
77 get { return literals; }
80 /// <summary>
81 /// Gets the parameters.
82 /// </summary>
83 /// <value>The parameters.</value>
84 public Dictionary<string, string> Parameters
86 get { return parameters; }
89 /// <summary>
90 /// Adds the specified literal.
91 /// </summary>
92 /// <param name="literal">The literal.</param>
93 public void Add(string literal)
95 literals.Add(literal);
98 /// <summary>
99 /// Adds the named.
100 /// </summary>
101 /// <param name="name">The name.</param>
102 /// <param name="value">The value.</param>
103 public void AddNamed(string name, string value)
105 parameters[name] = value;