Added container accessor to Castle.Core
[castle.git] / Tools / Castle.DynamicProxy2 / Castle.DynamicProxy / IProxyBuilder.cs
blob9a61d7e849865ba72ce824a075c1d7d602defe9b
1 // Copyright 2004-2007 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.DynamicProxy
17 using System;
19 /// <summary>
20 /// Abstracts the implementation of proxy constructions
21 /// </summary>
22 public interface IProxyBuilder
24 /// <summary>
25 /// Gets the module scope used by this builder for generating code.
26 /// </summary>
27 /// <value>The module scope used by this builder.</value>
28 ModuleScope ModuleScope { get; }
30 /// <summary>
31 /// Implementors should return a proxy for the specified type.
32 /// </summary>
33 /// <param name="theClass">The proxy base class.</param>
34 /// <param name="options">The proxy generation options.</param>
35 /// <returns>The generated proxy type.</returns>
36 Type CreateClassProxy(Type theClass, ProxyGenerationOptions options);
38 /// <summary>
39 /// Implementors should return a proxy for the specified
40 /// type and interfaces. The interfaces must be only "mark" interfaces
41 /// </summary>
42 /// <param name="theClass"></param>
43 /// <param name="interfaces"></param>
44 /// <param name="options"></param>
45 /// <returns></returns>
46 Type CreateClassProxy(Type theClass, Type[] interfaces, ProxyGenerationOptions options);
48 /// <summary>
49 /// Implementors should return a proxy for the specified
50 /// interface that 'proceeds' executions to the
51 /// specified target.
52 /// </summary>
53 /// <param name="theInterface"></param>
54 /// <param name="interfaces"></param>
55 /// <param name="targetType"></param>
56 /// <param name="options"></param>
57 /// <returns></returns>
58 Type CreateInterfaceProxyTypeWithTarget(Type theInterface, Type[] interfaces, Type targetType,
59 ProxyGenerationOptions options);
61 /// <summary>
62 /// Implementors should return a proxy for the specified
63 /// interface that delegate all executions to the
64 /// specified interceptor(s).
65 /// </summary>
66 /// <param name="theInterface"></param>
67 /// <param name="interfaces"></param>
68 /// <param name="options"></param>
69 /// <returns></returns>
70 Type CreateInterfaceProxyTypeWithoutTarget(Type theInterface, Type[] interfaces, ProxyGenerationOptions options);
72 /// <summary>
73 /// Implementors should return a proxy for the specified
74 /// interface that delegate all executions to the
75 /// specified interceptor(s) and uses an instance of the interface
76 /// as their targets, rather than a class. All IInvocation's
77 /// should then implement IChangeProxyTarget.
78 /// </summary>
79 /// <param name="theInterface"></param>
80 /// <param name="options"></param>
81 /// <returns></returns>
82 Type CreateInterfaceProxyTypeWithTargetInterface(Type theInterface, ProxyGenerationOptions options);