Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Deprecations:
- `Castle.Core.Internal.Lock` (class)
- `Castle.Core.Internal.ILockHolder` (interface)
- `Castle.Core.Internal.IUpgradeableLockHolder` (interface)
- You should no longer manually emit types into DynamicProxy's dynamic assembly. For this reason, the following member has been deprecated. (@stakx, #445)
- `Castle.DynamicProxy.ModuleScope.DefineType` (method)
- The proxy type cache in `ModuleScope` should no longer be accessed directly. For this reason, the members listed below have been deprecated. (@stakx, #391)
- `Castle.DynamicProxy.ModuleScope.Lock` (property)
- `Castle.DynamicProxy.ModuleScope.GetFromCache` (method)
Expand Down
1 change: 1 addition & 0 deletions ref/Castle.Core-net35.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2647,6 +2647,7 @@ public ModuleScope(bool savePhysicalAssembly, bool disableSignedModule, Castle.D
public System.Reflection.Emit.ModuleBuilder WeakNamedModule { get; }
public string WeakNamedModuleDirectory { get; }
public string WeakNamedModuleName { get; }
[System.ObsoleteAttribute("Exposes a component that is intended for internal use only.")]
public System.Reflection.Emit.TypeBuilder DefineType(bool inSignedModulePreferably, string name, System.Reflection.TypeAttributes flags) { }
[System.ObsoleteAttribute("Exposes a component that is intended for internal use only.")]
public System.Type GetFromCache(Castle.DynamicProxy.Generators.CacheKey key) { }
Expand Down
1 change: 1 addition & 0 deletions ref/Castle.Core-net40.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2694,6 +2694,7 @@ public ModuleScope(bool savePhysicalAssembly, bool disableSignedModule, Castle.D
public System.Reflection.Emit.ModuleBuilder WeakNamedModule { get; }
public string WeakNamedModuleDirectory { get; }
public string WeakNamedModuleName { get; }
[System.ObsoleteAttribute("Exposes a component that is intended for internal use only.")]
public System.Reflection.Emit.TypeBuilder DefineType(bool inSignedModulePreferably, string name, System.Reflection.TypeAttributes flags) { }
[System.ObsoleteAttribute("Exposes a component that is intended for internal use only.")]
public System.Type GetFromCache(Castle.DynamicProxy.Generators.CacheKey key) { }
Expand Down
1 change: 1 addition & 0 deletions ref/Castle.Core-net45.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2694,6 +2694,7 @@ public ModuleScope(bool savePhysicalAssembly, bool disableSignedModule, Castle.D
public System.Reflection.Emit.ModuleBuilder WeakNamedModule { get; }
public string WeakNamedModuleDirectory { get; }
public string WeakNamedModuleName { get; }
[System.ObsoleteAttribute("Exposes a component that is intended for internal use only.")]
public System.Reflection.Emit.TypeBuilder DefineType(bool inSignedModulePreferably, string name, System.Reflection.TypeAttributes flags) { }
[System.ObsoleteAttribute("Exposes a component that is intended for internal use only.")]
public System.Type GetFromCache(Castle.DynamicProxy.Generators.CacheKey key) { }
Expand Down
1 change: 1 addition & 0 deletions ref/Castle.Core-netstandard1.3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1543,6 +1543,7 @@ public ModuleScope(bool savePhysicalAssembly, bool disableSignedModule, Castle.D
public string StrongNamedModuleName { get; }
public System.Reflection.Emit.ModuleBuilder WeakNamedModule { get; }
public string WeakNamedModuleName { get; }
[System.ObsoleteAttribute("Exposes a component that is intended for internal use only.")]
public System.Reflection.Emit.TypeBuilder DefineType(bool inSignedModulePreferably, string name, System.Reflection.TypeAttributes flags) { }
[System.ObsoleteAttribute("Exposes a component that is intended for internal use only.")]
public System.Type GetFromCache(Castle.DynamicProxy.Generators.CacheKey key) { }
Expand Down
1 change: 1 addition & 0 deletions ref/Castle.Core-netstandard1.5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1543,6 +1543,7 @@ public ModuleScope(bool savePhysicalAssembly, bool disableSignedModule, Castle.D
public string StrongNamedModuleName { get; }
public System.Reflection.Emit.ModuleBuilder WeakNamedModule { get; }
public string WeakNamedModuleName { get; }
[System.ObsoleteAttribute("Exposes a component that is intended for internal use only.")]
public System.Reflection.Emit.TypeBuilder DefineType(bool inSignedModulePreferably, string name, System.Reflection.TypeAttributes flags) { }
[System.ObsoleteAttribute("Exposes a component that is intended for internal use only.")]
public System.Type GetFromCache(Castle.DynamicProxy.Generators.CacheKey key) { }
Expand Down
2 changes: 2 additions & 0 deletions src/Castle.Core/DynamicProxy/ModuleScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,8 @@ public void LoadAssemblyIntoCache(Assembly assembly)
}
#endif

[Obsolete("Exposes a component that is intended for internal use only.")] // TODO: Redeclare this method as `internal`.
[EditorBrowsable(EditorBrowsableState.Never)]
public TypeBuilder DefineType(bool inSignedModulePreferably, string name, TypeAttributes flags)
{
var module = ObtainDynamicModule(disableSignedModule == false && inSignedModulePreferably);
Expand Down