GetInstance() public static method

Creates a new instance of the ProxyFactory.
public static GetInstance ( ) : ProxyFactory
return ProxyFactory
Esempio n. 1
0
 ///<summary>
 /// Factory method to create a new proxy instance.
 ///</summary>
 ///<param name="interceptors">List of interceptors to be called before the actual method gets executed.</param>
 ///<param name="aditionalInterfaces">Aditional interfaces to be implemented by the proxy instance.</param>
 internal static object NewInstance <TInterface>(IInterceptor[] interceptors = null, Type[] aditionalInterfaces = null)
 {
     return(ProxyFactory.GetInstance().Create(new DynamicProxy(null, interceptors), typeof(TInterface), aditionalInterfaces));
 }
Esempio n. 2
0
 ///<summary>
 /// Factory method to create a new proxy instance.
 ///</summary>
 ///<param name="objectInstance">Instance of object to be proxied</param>
 ///<param name="interceptors">List of interceptors to be called before the actual method gets executed.</param>
 ///<param name="aditionalInterfaces">Aditional interfaces to be implemented by the proxy instance.</param>
 internal static object NewInstance(object objectInstance, IInterceptor[] interceptors = null, Type[] aditionalInterfaces = null)
 {
     return(ProxyFactory.GetInstance().Create(new DynamicProxy(objectInstance, interceptors), objectInstance.GetType(), aditionalInterfaces));
 }