User: xtoff
Date: 2009/11/15 04:19 AM

Modified:
 /DynamicProxy/trunk/src/Castle.DynamicProxy.Tests/
  ModuleScopeTestCase.cs, PersistentProxyBuilderTestCase.cs
 /DynamicProxy/trunk/src/Castle.DynamicProxy/
  DefaultProxyBuilder.cs, IProxyBuilder.cs, ProxyGenerator.cs
 /DynamicProxy/trunk/src/Castle.DynamicProxy/Generators/
  BaseProxyGenerator.cs

Log:
 - Obsoleted IProxyBuilder.CreateClassProxy method, added CreateClassProxyType 
for consistency with other kinds of proxies

File Changes:

Directory: /DynamicProxy/trunk/src/Castle.DynamicProxy/
=======================================================

File [modified]: DefaultProxyBuilder.cs
Delta lines: +1 -1
===================================================================

--- DynamicProxy/trunk/src/Castle.DynamicProxy/Generators/BaseProxyGenerator.cs 
2009-11-15 11:16:12 UTC (rev 6329)
+++ DynamicProxy/trunk/src/Castle.DynamicProxy/Generators/BaseProxyGenerator.cs 
2009-11-15 11:19:24 UTC (rev 6330)
@@ -98,7 +98,7 @@
                        get { return scope; }
                }
 
-               protected virtual ClassEmitter BuildClassEmitter(String 
typeName, Type parentType, IEnumerable<Type> interfaces)
+               protected virtual ClassEmitter BuildClassEmitter(string 
typeName, Type parentType, IEnumerable<Type> interfaces)
                {
                        CheckNotGenericTypeDefinition(parentType, "parentType");

File [modified]: IProxyBuilder.cs
Delta lines: +1 -1
===================================================================

--- DynamicProxy/trunk/src/Castle.DynamicProxy/ProxyGenerator.cs        
2009-11-15 11:16:12 UTC (rev 6329)
+++ DynamicProxy/trunk/src/Castle.DynamicProxy/ProxyGenerator.cs        
2009-11-15 11:19:24 UTC (rev 6330)
@@ -962,7 +962,7 @@
                protected Type CreateClassProxyType(Type classToProxy, Type[] 
additionalInterfacesToProxy, ProxyGenerationOptions options)
                {
                        // create proxy
-                       return ProxyBuilder.CreateClassProxy(classToProxy, 
additionalInterfacesToProxy, options);
+                       return ProxyBuilder.CreateClassProxyType(classToProxy, 
additionalInterfacesToProxy, options);
                }
 

File [modified]: ProxyGenerator.cs
Delta lines: +8 -8
===================================================================

--- DynamicProxy/trunk/src/Castle.DynamicProxy.Tests/ModuleScopeTestCase.cs     
2009-11-15 11:16:12 UTC (rev 6329)
+++ DynamicProxy/trunk/src/Castle.DynamicProxy.Tests/ModuleScopeTestCase.cs     
2009-11-15 11:19:24 UTC (rev 6330)
@@ -289,7 +289,7 @@
                {
                        ModuleScope scope = new ModuleScope(true);
                        DefaultProxyBuilder builder = new 
DefaultProxyBuilder(scope);
-                       Type cp = builder.CreateClassProxy(typeof (object), 
ProxyGenerationOptions.Default);
+                       Type cp = builder.CreateClassProxyType(typeof(object), 
Type.EmptyTypes, ProxyGenerationOptions.Default);
 
                        string savedPath = scope.SaveAssembly();
 
@@ -386,7 +386,7 @@
                [Test]
                public void LoadAssemblyIntoCache_CreateClassProxy()
                {
-                       CheckLoadAssemblyIntoCache(builder => 
builder.CreateClassProxy(typeof (object), null, 
ProxyGenerationOptions.Default));
+                       CheckLoadAssemblyIntoCache(builder => 
builder.CreateClassProxyType(typeof (object), null, 
ProxyGenerationOptions.Default));
                }
 
                [Test]
@@ -430,11 +430,11 @@
                        options1.AddMixinInstance(new DateTime());
                        ProxyGenerationOptions options2 = 
ProxyGenerationOptions.Default;
 
-                       Type cp1 = builder.CreateClassProxy(typeof (object), 
options1);
-                       Type cp2 = builder.CreateClassProxy(typeof (object), 
options2);
+                       Type cp1 = builder.CreateClassProxyType(typeof(object), 
Type.EmptyTypes, options1);
+                       Type cp2 = builder.CreateClassProxyType(typeof(object), 
Type.EmptyTypes, options2);
                        Assert.AreNotSame(cp1, cp2);
-                       Assert.AreSame(cp1, builder.CreateClassProxy(typeof 
(object), options1));
-                       Assert.AreSame(cp2, builder.CreateClassProxy(typeof 
(object), options2));
+                       Assert.AreSame(cp1, 
builder.CreateClassProxyType(typeof(object), Type.EmptyTypes, options1));
+                       Assert.AreSame(cp2, 
builder.CreateClassProxyType(typeof(object), Type.EmptyTypes, options2));
 
                        string path = savedScope.SaveAssembly();
 
@@ -450,8 +450,8 @@
                                                                                
newOptions1.AddMixinInstance(new DateTime());
                                                                                
ProxyGenerationOptions newOptions2 = ProxyGenerationOptions.Default;
 
-                                                                               
Type loadedCP1 = newBuilder.CreateClassProxy(typeof (object), newOptions1);
-                                                                               
Type loadedCP2 = newBuilder.CreateClassProxy(typeof (object), newOptions2);
+                                                                               
                                        Type loadedCP1 = 
newBuilder.CreateClassProxyType(typeof(object), Type.EmptyTypes, newOptions1);
+                                                                               
                                        Type loadedCP2 = 
newBuilder.CreateClassProxyType(typeof(object), Type.EmptyTypes, newOptions2);
                                                                                
Assert.AreNotSame(loadedCP1, loadedCP2);
                                                                                
Assert.AreEqual(assembly, loadedCP1.Assembly);

Directory: /DynamicProxy/trunk/src/Castle.DynamicProxy.Tests/
=============================================================

File [modified]: ModuleScopeTestCase.cs
Delta lines: +1 -1
===================================================================

--- 
DynamicProxy/trunk/src/Castle.DynamicProxy.Tests/PersistentProxyBuilderTestCase.cs
  2009-11-15 11:16:12 UTC (rev 6329)
+++ 
DynamicProxy/trunk/src/Castle.DynamicProxy.Tests/PersistentProxyBuilderTestCase.cs
  2009-11-15 11:19:24 UTC (rev 6330)
@@ -34,7 +34,7 @@
                public void PersistentProxyBuilder_SavesSignedFile()
                {
                        PersistentProxyBuilder builder = new 
PersistentProxyBuilder();
-                       builder.CreateClassProxy(typeof (object), 
ProxyGenerationOptions.Default);
+                       builder.CreateClassProxyType(typeof(object), 
Type.EmptyTypes, ProxyGenerationOptions.Default);
                        string path = builder.SaveAssembly();
                        Assert.IsNotNull(path);

File [modified]: PersistentProxyBuilderTestCase.cs
Delta lines: +0 -0
===================================================================

Directory: /DynamicProxy/trunk/src/Castle.DynamicProxy/Generators/
==================================================================

File [modified]: BaseProxyGenerator.cs
Delta lines: +20 -1
===================================================================

--- DynamicProxy/trunk/src/Castle.DynamicProxy/IProxyBuilder.cs 2009-11-15 
11:16:12 UTC (rev 6329)
+++ DynamicProxy/trunk/src/Castle.DynamicProxy/IProxyBuilder.cs 2009-11-15 
11:19:24 UTC (rev 6330)
@@ -41,7 +41,7 @@
                /// Note that to avoid this exception, you can mark offending 
type internal, and define <see cref="InternalsVisibleToAttribute"/> 
                /// pointing to Castle Dynamic Proxy assembly, in assembly 
containing that type, if this is appropriate.</exception>
                /// <seealso cref="ClassProxyGenerator"/>
-               [Obsolete("Use thie other overload.")]
+               [Obsolete("Use CreateClassProxyType method instead.")]
                Type CreateClassProxy(Type classToProxy, ProxyGenerationOptions 
options);
 
                /// <summary>
@@ -60,9 +60,28 @@
                /// Note that to avoid this exception, you can mark offending 
type internal, and define <see cref="InternalsVisibleToAttribute"/> 
                /// pointing to Castle Dynamic Proxy assembly, in assembly 
containing that type, if this is appropriate.</exception>
                /// <seealso cref="ClassProxyGenerator"/>
+               [Obsolete("Use CreateClassProxyType method instead.")]
                Type CreateClassProxy(Type classToProxy, Type[] 
additionalInterfacesToProxy, ProxyGenerationOptions options);
 
                /// <summary>
+               /// Creates a proxy type for given <paramref 
name="classToProxy"/>, implementing <paramref 
name="additionalInterfacesToProxy"/>, using <paramref name="options"/> provided.
+               /// </summary>
+               /// <param name="classToProxy">The class type to proxy.</param>
+               /// <param name="additionalInterfacesToProxy">Additional 
interface types to proxy.</param>
+               /// <param name="options">The proxy generation options.</param>
+               /// <returns>The generated proxy type.</returns>
+               /// <remarks>
+               /// Implementers should return a proxy type for the specified 
class and interfaces.
+               /// Additional interfaces should be only 'mark' interfaces, 
that is, they should work like interface proxy without target. (See <see 
cref="CreateInterfaceProxyTypeWithoutTarget"/> method.)
+               /// </remarks>
+               /// <exception cref="GeneratorException">Thrown when <paramref 
name="classToProxy"/> or any of <paramref name="additionalInterfacesToProxy"/> 
is a generic type definition.</exception>
+               /// <exception cref="GeneratorException">Thrown when <paramref 
name="classToProxy"/> or any of <paramref name="additionalInterfacesToProxy"/> 
is not public.
+               /// Note that to avoid this exception, you can mark offending 
type internal, and define <see cref="InternalsVisibleToAttribute"/> 
+               /// pointing to Castle Dynamic Proxy assembly, in assembly 
containing that type, if this is appropriate.</exception>
+               /// <seealso cref="ClassProxyGenerator"/>
+               Type CreateClassProxyType(Type classToProxy, Type[] 
additionalInterfacesToProxy, ProxyGenerationOptions options);
+
+               /// <summary>
                /// Creates a proxy type that proxies calls to <paramref 
name="interfaceToProxy"/> members on <paramref name="targetType"/>, 
implementing <paramref name="additionalInterfacesToProxy"/>, using <paramref 
name="options"/> provided.
                /// </summary>

--

You received this message because you are subscribed to the Google Groups 
"Castle Project Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-commits?hl=.


Reply via email to