Intercept.NewInstanceWithAdditionalInterfaces Method

Creates a new instance of type type that is intercepted with the behaviors in interceptionBehaviors.

Namespace:  Microsoft.Practices.Unity.InterceptionExtension
Assembly:  Microsoft.Practices.Unity.Interception (in Microsoft.Practices.Unity.Interception.dll)


Public Shared Function NewInstanceWithAdditionalInterfaces ( _
    type As Type, _
    interceptor As ITypeInterceptor, _
    interceptionBehaviors As IEnumerable(Of IInterceptionBehavior), _
    additionalInterfaces As IEnumerable(Of Type), _
    ParamArray constructorParameters As Object() _
) As Object
public static Object NewInstanceWithAdditionalInterfaces(
    Type type,
    ITypeInterceptor interceptor,
    IEnumerable<IInterceptionBehavior> interceptionBehaviors,
    IEnumerable<Type> additionalInterfaces,
    params Object[] constructorParameters
static Object^ NewInstanceWithAdditionalInterfaces(
    Type^ type, 
    ITypeInterceptor^ interceptor, 
    IEnumerable<IInterceptionBehavior^>^ interceptionBehaviors, 
    IEnumerable<Type^>^ additionalInterfaces, 
    ... array<Object^>^ constructorParameters
public static function NewInstanceWithAdditionalInterfaces(
    type : Type, 
    interceptor : ITypeInterceptor, 
    interceptionBehaviors : IEnumerable<IInterceptionBehavior>, 
    additionalInterfaces : IEnumerable<Type>, 
    ... constructorParameters : Object[]
) : Object


  • type
    Type: System.Type
    The type of the object to create.
  • constructorParameters
    Type: array<System.Object[]
    The arguments for the creation of the new instance.

Return Value

An instance of a class compatible with type that includes execution of the given interceptionBehaviors.


Exception Condition
System.ArgumentNullException when type is nulla null reference (Nothing in Visual Basic).
System.ArgumentNullException when interceptor is nulla null reference (Nothing in Visual Basic).
System.ArgumentNullException when interceptionBehaviors is nulla null reference (Nothing in Visual Basic).
System.ArgumentNullException when additionalInterfaces is nulla null reference (Nothing in Visual Basic).
System.ArgumentException when interceptor cannot intercept type.

See Also

Intercept Class

Microsoft.Practices.Unity.InterceptionExtension Namespace