More working tests.
[castle.git] / MonoRail / Castle.MonoRail.Framework / IControllerDescriptorProvider.cs
blob66676eacad6497ef5df16f9ec1d527c68858b01a
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;
18 using Castle.MonoRail.Framework.Descriptors;
19 using Castle.MonoRail.Framework.Providers;
21 /// <summary>
22 /// Creator delegate
23 /// </summary>
24 public delegate ControllerMetaDescriptor MetaCreatorHandler();
26 /// <summary>
27 /// ControllerMetaDescriptor delegate
28 /// </summary>
29 /// <returns></returns>
30 public delegate void ControllerMetaDescriptorHandler(ControllerMetaDescriptor metaDesc);
32 /// <summary>
33 /// Action meta creator delegate
34 /// </summary>
35 public delegate ActionMetaDescriptor ActionMetaCreatorHandler();
37 /// <summary>
38 /// ActionMetaDescriptor delegate
39 /// </summary>
40 public delegate void ActionMetaDescriptorHandler(ActionMetaDescriptor actionMetaDesc);
42 /// <summary>
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.
46 /// </summary>
47 public interface IControllerDescriptorProvider : IProvider
49 /// <summary>
50 /// Occurs when the providers needs to create a <see cref="ControllerMetaDescriptor" />.
51 /// </summary>
52 event MetaCreatorHandler Create;
54 /// <summary>
55 /// Occurs when the meta descriptor is about to the returned to the caller.
56 /// </summary>
57 event ControllerMetaDescriptorHandler AfterProcess;
59 /// <summary>
60 /// Occurs when the providers needs to create a <see cref="ActionMetaDescriptor" />.
61 /// </summary>
62 event ActionMetaCreatorHandler ActionCreate;
64 /// <summary>
65 /// Occurs when the meta descriptor is about to be included on the <see cref="ControllerMetaDescriptor"/>.
66 /// </summary>
67 event ActionMetaDescriptorHandler AfterActionProcess;
69 /// <summary>
70 /// Builds the descriptor.
71 /// </summary>
72 /// <param name="controller">The controller.</param>
73 /// <returns></returns>
74 ControllerMetaDescriptor BuildDescriptor(IController controller);
76 /// <summary>
77 /// Builds the descriptor.
78 /// </summary>
79 /// <param name="controllerType">Type of the controller.</param>
80 /// <returns></returns>
81 ControllerMetaDescriptor BuildDescriptor(Type controllerType);