public static void Create_Using_InternalServiceWithGenericArgumentBeingNonPublicExternalService() { Assert.NotNull(DispatchProxy.Create <TestType_InternalInterfaceWithNonPublicExternalGenericArgument, TestDispatchProxy>()); }
public static void Create_Using_InternalProxyWithBaseTypeImplementingServiceWithgenericArgumentBeingNonPublicExternalService() { Assert.NotNull(DispatchProxy.Create <TestType_IHelloService, TestType_InternalProxyImplementingInterfaceWithGenericArgumentBeingNonPublicExternalType>()); }
public static void Create_Using_InternalProxyWithExternalNonPublicBaseType() { Assert.NotNull(DispatchProxy.Create <TestType_IHelloService, TestType_InternalProxyInternalBaseType>()); }
public static void Create_Using_InternalServiceImplementingNonPublicExternalService() { Assert.NotNull(DispatchProxy.Create <TestType_InternalInterfaceImplementsNonPublicExternalType, TestDispatchProxy>()); }
public static void Create_Using_Concrete_Proxy_Type_Throws_ArgumentException() { AssertExtensions.Throws <ArgumentException>("T", () => DispatchProxy.Create <TestType_ConcreteClass, TestDispatchProxy>()); }
private static TestType_IHelloService CreateTestHelloProxy() => DispatchProxy.Create <TestType_IHelloService, TestDispatchProxy>();
public static T Create <T>() { return(DispatchProxy.Create <T, DispatcherProxy>()); }
public static void Create_Proxy_Implements_Internal_Interfaces() { TestType_InternalInterfaceService proxy = DispatchProxy.Create <TestType_PublicInterfaceService_Implements_Internal, TestDispatchProxy>(); Assert.NotNull(proxy); }
public static void Create_Using_Sealed_BaseType_Throws_ArgumentException() { Assert.Throws <ArgumentException>("TProxy", () => DispatchProxy.Create <TestType_IHelloService, Sealed_TestDispatchProxy>()); }
/// <summary> /// 创建代理 /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public static T Create <T>() { return(DispatchProxy.Create <T, RpcProxyImpl <T> >()); }
static void Main(string[] args) { //MySql.Data.MySqlClient.MySqlClientFactory var queryProxy = DispatchProxy.Create <ISql, SqlProxy>(); }
// 为目标对象生成代理对象 public Object GetProxyInstance <T, TProxy>() where TProxy : DispatchProxy { return(DispatchProxy.Create <T, TProxy>()); }
public T GetService <T>() { return(DispatchProxy.Create <T, InvokeProxy <T> >()); }
/// <summary> /// Factory for a SimpleDictionaryProxy /// </summary> /// <typeparam name="TInterface"></typeparam> /// <returns>Proxy which implements TInterface via SimpleDictionaryProxy</returns> public static TInterface Create <TInterface>() { return(DispatchProxy.Create <TInterface, SimpleDictionaryProxy>()); }
public static T Proxy <T>() { return(DispatchProxy.Create <T, InvokeProxy <T> >()); }
public static void Create_Using_BaseType_Without_Default_Ctor_Throws_ArgumentException() { AssertExtensions.Throws <ArgumentException>("TProxy", () => DispatchProxy.Create <TestType_IHelloService, NoDefaultCtor_TestDispatchProxy>()); }
public static void Create_Using_InternalProxy() { Assert.NotNull(DispatchProxy.Create <TestType_InternalInterfaceService, InternalInvokeProxy>()); }
public static T Create <T>() { var proxy = DispatchProxy.Create <T, InvokeProxy>(); return(proxy); }
public static void Create_Using_ExternalNonPublicService() { Assert.NotNull(DispatchProxy.Create <DispatchProxyTestDependency.TestType_IExternalNonPublicHiService, TestDispatchProxy>()); }
public static void Create_Using_Abstract_BaseType_Throws_ArgumentException() { AssertExtensions.Throws <ArgumentException>("TProxy", () => DispatchProxy.Create <TestType_IHelloService, Abstract_TestDispatchProxy>()); }
/// <summary> /// Generate instance of given interface using DispatchProxy /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public T Create <T>() { return(DispatchProxy.Create <T, DefaultDispatchProxy>()); }