Navigation Menu

Skip to content

Commit

Permalink
Minor changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Tamme committed Nov 17, 2013
1 parent b9ddc8b commit daeb0df
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
@@ -0,0 +1,2 @@
# This setting will tell git to handle the files specified automatically. This is a good default option.
* text=auto
Expand Up @@ -118,13 +118,13 @@ private static HashSet<Type> ExtractAdditionalInterfaces(IEnumerable<Type> inter
private static void AddAdditionalInterfaces(Type interfaceType, ICollection<Type> declaringInterfaceTypes, HashSet<Type> additionalInterfaceTypes)
{
if (interfaceType == null)
throw new ArgumentException(Resources.Error_InterfaceTypeMustNotBeNull, "interfaceType");
throw new ArgumentException(Resources.Error_InterfaceTypeMustNotBeNull, "interfaceType");

if (!interfaceType.IsInterface)
throw new ArgumentException(String.Format(Resources.Error_TypeNotAnInterfaceType, interfaceType), "interfaceType");
throw new ArgumentException(String.Format(Resources.Error_TypeNotAnInterfaceType, interfaceType), "interfaceType");

if (interfaceType.IsGenericTypeDefinition)
throw new ArgumentException(String.Format(Resources.Error_InterfaceTypeMustNotBeAGenericTypeDefinition, interfaceType), "interfaceType");
throw new ArgumentException(String.Format(Resources.Error_InterfaceTypeMustNotBeAGenericTypeDefinition, interfaceType), "interfaceType");

// Add interface type.
if (declaringInterfaceTypes.Contains(interfaceType))
Expand Down
2 changes: 1 addition & 1 deletion Source/Main/NProxy.Core/Proxy.cs
Expand Up @@ -119,7 +119,7 @@ public object AdaptInstance(Type interfaceType, object instance)
throw new ArgumentNullException("interfaceType");

if (!interfaceType.IsInterface)
throw new ArgumentException(String.Format(Resources.Error_TypeNotAnInterfaceType, interfaceType), "interfaceType");
throw new ArgumentException(String.Format(Resources.Error_TypeNotAnInterfaceType, interfaceType), "interfaceType");

var proxyInstance = _proxyTemplate.UnwrapInstance(instance);
var proxyType = proxyInstance.GetType();
Expand Down
4 changes: 2 additions & 2 deletions Source/Main/NProxy.Core/ProxyTypeBuilder.cs
Expand Up @@ -299,10 +299,10 @@ public void AddInterface(Type interfaceType)
throw new ArgumentNullException("interfaceType");

if (!interfaceType.IsInterface)
throw new ArgumentException(String.Format(Resources.Error_TypeNotAnInterfaceType, interfaceType), "interfaceType");
throw new ArgumentException(String.Format(Resources.Error_TypeNotAnInterfaceType, interfaceType), "interfaceType");

if (interfaceType.IsGenericTypeDefinition)
throw new ArgumentException(String.Format(Resources.Error_InterfaceTypeMustNotBeAGenericTypeDefinition, interfaceType), "interfaceType");
throw new ArgumentException(String.Format(Resources.Error_InterfaceTypeMustNotBeAGenericTypeDefinition, interfaceType), "interfaceType");

_typeBuilder.AddInterfaceImplementation(interfaceType);

Expand Down

0 comments on commit daeb0df

Please sign in to comment.