Removed untyped contructor from ComponentRegistration and add a protected setter.
[castle.git] / MonoRail / Castle.MonoRail.Framework / Attributes / ControllerDetailsAttribute.cs
blob697efc469546356da364ca717c6020c89c797bc4
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
17 using System;
19 /// <summary>
20 /// Decorates a controller with a different name
21 /// and optionally an area which the controller belongs to.
22 /// This is used to override the convention for controller
23 /// names and to optionally associate a controller with an
24 /// area name.
25 /// </summary>
26 [AttributeUsage(AttributeTargets.Class), Serializable]
27 public class ControllerDetailsAttribute : Attribute
29 private String name;
30 private String area = String.Empty;
31 private bool sessionless = false;
33 /// <summary>
34 /// Constructs a ControllerDetailsAttribute
35 /// </summary>
36 public ControllerDetailsAttribute()
40 /// <summary>
41 /// Constructs a ControllerDetailsAttribute
42 /// with a name for the controller.
43 /// </summary>
44 /// <param name="name">The specified Controller Name</param>
45 public ControllerDetailsAttribute( String name )
47 this.name = name;
50 /// <summary>
51 /// The controller's name
52 /// </summary>
53 public String Name
55 get { return name; }
58 /// <summary>
59 /// The controller's area
60 /// </summary>
61 public String Area
63 get { return area; }
64 set { area = value; }
67 /// <summary>
68 /// Gets or sets a value indicating whether the controller does not need a session.
69 /// Defaults to <c>false</c>.
70 /// </summary>
71 /// <value><c>true</c> if sessionless; otherwise, <c>false</c>.</value>
72 public bool Sessionless
74 get { return sessionless; }
75 set { sessionless = value; }