1
// Copyright 2004-2008 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
.Collections
;
22 public class RoutingRuleWithActionDecorator
: IRoutingRule
24 private readonly IRoutingRule inner
;
25 private readonly RouteAction action
;
28 /// Initializes a new instance of the <see cref="RoutingRuleWithActionDecorator"/> class.
30 /// <param name="inner">The real routing rule.</param>
31 /// <param name="action">The action.</param>
32 public RoutingRuleWithActionDecorator(IRoutingRule inner
, RouteAction action
)
41 /// <param name="hostname">The hostname.</param>
42 /// <param name="virtualPath">The virtual path.</param>
43 /// <param name="parameters">The parameters.</param>
44 /// <param name="points">The points.</param>
45 /// <returns></returns>
46 public string CreateUrl(string hostname
, string virtualPath
, IDictionary parameters
, out int points
)
48 return inner
.CreateUrl(hostname
, virtualPath
, parameters
, out points
);
52 /// Determines if the specified URL matches the
55 /// <param name="url">The URL.</param>
56 /// <param name="context">The context</param>
57 /// <param name="match">The match.</param>
58 /// <returns></returns>
59 public int Matches(string url
, IRouteContext context
, RouteMatch match
)
61 return inner
.Matches(url
, context
, match
);
62 // bool matches = inner.Matches(url, context, match);
66 // action(context, match);
73 /// Gets the name of the route.
75 /// <value>The name of the route.</value>
76 public string RouteName
78 get { return inner.RouteName; }