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
18 using Castle
.MonoRail
.Framework
.Descriptors
;
19 using Castle
.MonoRail
.Framework
.Providers
;
24 public delegate ControllerMetaDescriptor
MetaCreatorHandler();
27 /// ControllerMetaDescriptor delegate
29 /// <returns></returns>
30 public delegate void ControllerMetaDescriptorHandler(ControllerMetaDescriptor metaDesc
);
33 /// Action meta creator delegate
35 public delegate ActionMetaDescriptor
ActionMetaCreatorHandler();
38 /// ActionMetaDescriptor delegate
40 public delegate void ActionMetaDescriptorHandler(ActionMetaDescriptor actionMetaDesc
);
43 /// Defines the contract for implementations that should
44 /// collect from one or more sources the meta information that
45 /// dictates the <see cref="IController"/> behavior and the actions it exposes.
47 public interface IControllerDescriptorProvider
: IProvider
50 /// Occurs when the providers needs to create a <see cref="ControllerMetaDescriptor" />.
52 event MetaCreatorHandler Create
;
55 /// Occurs when the meta descriptor is about to the returned to the caller.
57 event ControllerMetaDescriptorHandler AfterProcess
;
60 /// Occurs when the providers needs to create a <see cref="ActionMetaDescriptor" />.
62 event ActionMetaCreatorHandler ActionCreate
;
65 /// Occurs when the meta descriptor is about to be included on the <see cref="ControllerMetaDescriptor"/>.
67 event ActionMetaDescriptorHandler AfterActionProcess
;
70 /// Builds the descriptor.
72 /// <param name="controller">The controller.</param>
73 /// <returns></returns>
74 ControllerMetaDescriptor
BuildDescriptor(IController controller
);
77 /// Builds the descriptor.
79 /// <param name="controllerType">Type of the controller.</param>
80 /// <returns></returns>
81 ControllerMetaDescriptor
BuildDescriptor(Type controllerType
);