1 // Copyright 2004-2007 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
20 /// Declares that the Controller should enable a DefaultAction method
21 /// for request processing if no action can be found with the supplied name
23 [AttributeUsage(AttributeTargets
.Class
| AttributeTargets
.Method
, AllowMultiple
=false), Serializable
]
24 public class DefaultActionAttribute
: Attribute
26 private static readonly String DEFAULT_ACTION
= "DefaultAction";
28 private String defaultAction
;
31 /// Constructs a <see cref="DefaultActionAttribute"/>
32 /// using <c>DefaultAction</c>
33 /// as the default action name
35 public DefaultActionAttribute()
37 defaultAction
= DEFAULT_ACTION
;
41 /// Constructs a <see cref="DefaultActionAttribute"/>
42 /// using the supplied value as the default action name
44 public DefaultActionAttribute(String action
)
46 defaultAction
= action
;
50 /// Gets the default action name
52 public String DefaultAction
54 get { return defaultAction; }