Skip to content

Commit

Permalink
Merge pull request #217 from castleproject/iproxygenerator
Browse files Browse the repository at this point in the history
Add IProxyGenerator interface for the ProxyGenerator class
  • Loading branch information
jonorossi authored Aug 5, 2016
2 parents 5ddeb0d + 40c6c40 commit 49cf7e2
Show file tree
Hide file tree
Showing 8 changed files with 1,054 additions and 14 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
Breaking Changes:
* Rework Serilog integration to accept an ILogger rather than a LoggerConfiguration to work correctly with Serilog (#142, #211)

## 4.0.0-beta001 (2016-07-17, [diff](https://github.com/castleproject/Core/compare/v4.0.0-alpha001...v4.0.0-beta001))
Enhancements:
* Add IProxyGenerator interface for the ProxyGenerator class (#215)

## 4.0.0-beta001 (2016-07-17)

Breaking Changes:
* Update to log4net 1.2.15/2.0.5 (#199)
Expand All @@ -19,7 +22,7 @@ Enhancements:
Bugfixes:
* Fix target framework moniker in NuGet package for .NET Core (#174)

## 4.0.0-alpha001 (2016-04-07, [diff](https://github.com/castleproject/Core/compare/v3.3.3...v4.0.0-alpha001))
## 4.0.0-alpha001 (2016-04-07)

Breaking Changes:
* Remove all Silverlight support (#100, #150)
Expand All @@ -39,7 +42,7 @@ Bugfixes:
* Fix ProxyGenerator cache does not take into account AdditionalAttributes (@cmerat, #77, #78)
* Fix Castle.Services.Logging.SerilogIntegration.dll missing some assembly info attributes (@imzshh, #20, #82)

## 3.3.3 (2014-11-06, [diff](http://github.com/castleproject/Core/compare/v3.3.2...v3.3.3))
## 3.3.3 (2014-11-06)
* Fix Serilog integration modifies LoggerConfiguration.MinimumLevel (#70)
* Add SourceContext to the Serilog logger (@KevivL, #69)

Expand Down
1 change: 1 addition & 0 deletions src/Castle.Core/Castle.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@
<Compile Include="DynamicProxy\Generators\AttributeDisassembler.cs" />
<Compile Include="DynamicProxy\Internal\TypeUtil.cs" />
<Compile Include="DynamicProxy\InvalidProxyConstructorArgumentsException.cs" />
<Compile Include="DynamicProxy\IProxyGenerator.cs" />
<Compile Include="DynamicProxy\ProxyUtil.cs" />
<Compile Include="DynamicProxy\Serialization\CacheMappingsAttribute.cs" />
<Compile Include="DynamicProxy\Contributors\ClassMembersCollector.cs" />
Expand Down
2 changes: 1 addition & 1 deletion src/Castle.Core/DynamicProxy/IAttributeDisassembler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Castle.DynamicProxy
using System.Reflection.Emit;

/// <summary>
/// Provides functionality for disassembling instances of attributes to CustomAttributeBuilder form, during the process of emiting new types by Dynamic Proxy.
/// Provides functionality for disassembling instances of attributes to CustomAttributeBuilder form, during the process of emiting new types by DynamicProxy.
/// </summary>
public interface IAttributeDisassembler
{
Expand Down
4 changes: 2 additions & 2 deletions src/Castle.Core/DynamicProxy/IChangeProxyTarget.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2004-2011 Castle Project - http://www.castleproject.org/
// Copyright 2004-2016 Castle Project - http://www.castleproject.org/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,7 @@ namespace Castle.DynamicProxy
using System;

/// <summary>
/// Exposes means to change target objects of proxies and invocations
/// Exposes means to change target objects of proxies and invocations.
/// </summary>
public interface IChangeProxyTarget
{
Expand Down
4 changes: 2 additions & 2 deletions src/Castle.Core/DynamicProxy/IInterceptor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2004-2011 Castle Project - http://www.castleproject.org/
// Copyright 2004-2016 Castle Project - http://www.castleproject.org/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
namespace Castle.DynamicProxy
{
/// <summary>
/// New interface that is going to be used by DynamicProxy 2
/// Provides the main DynamicProxy extension point that allows member interception.
/// </summary>
public interface IInterceptor
{
Expand Down
1,033 changes: 1,033 additions & 0 deletions src/Castle.Core/DynamicProxy/IProxyGenerator.cs

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/Castle.Core/DynamicProxy/IProxyTargetAccessor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2004-2011 Castle Project - http://www.castleproject.org/
// Copyright 2004-2016 Castle Project - http://www.castleproject.org/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -14,6 +14,10 @@

namespace Castle.DynamicProxy
{
/// <summary>
/// Exposes access to the target object and interceptors of proxy objects.
/// This is a DynamicProxy infrastructure interface and should not be implemented yourself.
/// </summary>
public interface IProxyTargetAccessor
{
/// <summary>
Expand Down
9 changes: 4 additions & 5 deletions src/Castle.Core/DynamicProxy/ProxyGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2004-2014 Castle Project - http://www.castleproject.org/
// Copyright 2004-2016 Castle Project - http://www.castleproject.org/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,7 +36,7 @@ namespace Castle.DynamicProxy
/// Provides proxy objects for classes and interfaces.
/// </summary>
[CLSCompliant(true)]
public class ProxyGenerator
public class ProxyGenerator : IProxyGenerator
{
private ILogger logger = NullLogger.Instance;
private readonly IProxyBuilder proxyBuilder;
Expand Down Expand Up @@ -560,7 +560,6 @@ public virtual object CreateInterfaceProxyWithTargetInterface(Type interfaceToPr
{
//TODO: add <example> to xml comments to show how to use IChangeProxyTarget


if (interfaceToProxy == null)
{
throw new ArgumentNullException("interfaceToProxy");
Expand Down Expand Up @@ -606,7 +605,6 @@ public virtual object CreateInterfaceProxyWithTargetInterface(Type interfaceToPr
}
}
}

#endif

CheckNotGenericTypeDefinition(interfaceToProxy, "interfaceToProxy");
Expand Down Expand Up @@ -646,7 +644,8 @@ public virtual object CreateInterfaceProxyWithTargetInterface(Type interfaceToPr
/// This method uses <see cref = "IProxyBuilder" /> implementation to generate a proxy type.
/// As such caller should expect any type of exception that given <see cref = "IProxyBuilder" /> implementation may throw.
/// </remarks>
public TInterface CreateInterfaceProxyWithoutTarget<TInterface>(IInterceptor interceptor) where TInterface : class
public TInterface CreateInterfaceProxyWithoutTarget<TInterface>(IInterceptor interceptor)
where TInterface : class
{
return (TInterface)CreateInterfaceProxyWithoutTarget(typeof(TInterface), interceptor);
}
Expand Down

0 comments on commit 49cf7e2

Please sign in to comment.