Fixing an issue with output parameters that are of type IntPtr
[castle.git] / MonoRail / Castle.MonoRail.Framework / Routing / RoutingRuleWithActionDecorator.cs
blobd9a9924142446a3aa93d314b510ef48286aed190
1 // Copyright 2004-2008 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.Collections;
19 /// <summary>
20 /// Pendent
21 /// </summary>
22 public class RoutingRuleWithActionDecorator : IRoutingRule
24 private readonly IRoutingRule inner;
25 private readonly RouteAction action;
27 /// <summary>
28 /// Initializes a new instance of the <see cref="RoutingRuleWithActionDecorator"/> class.
29 /// </summary>
30 /// <param name="inner">The real routing rule.</param>
31 /// <param name="action">The action.</param>
32 public RoutingRuleWithActionDecorator(IRoutingRule inner, RouteAction action)
34 this.inner = inner;
35 this.action = action;
38 /// <summary>
39 /// Pendent
40 /// </summary>
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);
51 /// <summary>
52 /// Determines if the specified URL matches the
53 /// routing rule.
54 /// </summary>
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);
64 // if (matches)
65 // {
66 // action(context, match);
67 // }
69 // return matches;
72 /// <summary>
73 /// Gets the name of the route.
74 /// </summary>
75 /// <value>The name of the route.</value>
76 public string RouteName
78 get { return inner.RouteName; }