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 /// Decorates a <see cref="ViewComponent"/> to associate a custom name with it.
23 /// Decorates a <see cref="ViewComponent"/> to associate a custom name with it.
25 /// Optionally you can associate the section names supported by the
26 /// <see cref="ViewComponent"/>.
30 /// In the code below, the class MyHeaderViewConponent will be referenced as just <c>Header</c>,
31 /// and it will support the subsections <c>header</c> and <c>footer</c>.
33 /// [ViewComponentDetails("Header", Sections="header,footer")
34 /// public class MyHeaderViewComponent : ViewComponent
42 /// <seealso cref="ViewComponent"/>
43 /// <seealso cref="ViewComponentParamAttribute"/>
45 [AttributeUsage(AttributeTargets
.Class
), Serializable
]
46 public class ViewComponentDetailsAttribute
: Attribute
48 private readonly string name
;
49 private string sections
;
52 /// Initializes a new instance of the <see cref="ViewComponentDetailsAttribute"/> class.
54 /// <param name="name">The specified ViewComponent's Name</param>
55 public ViewComponentDetailsAttribute(String name
)
61 /// The component's name
69 /// Sets the nested sections that this <see cref="ViewComponent"/> supports.
71 /// <value>The nested sections names, comma separated.</value>
72 public string Sections
74 get { return sections; }
75 set { sections = value; }