public IPlatformProxy CreateProxy(IntegrationProxyArgs args) { if (args.Platform == SuportedPlatforms.SalePlatform) { return(new SalePlatformProxy()); }//se houvessem varias, daria para decorar os Proxies e buscar o correto por reflection, eliminando condicionais throw new PlatformNotSupportedException("Not supported platform"); }
public static IntegrationProxy GetInstance(IntegrationProxyArgs args) { if (_instance == null) { _instance = new IntegrationProxy(args); } return(_instance); }
public IntegrationProxyArgsBuilder() { this.args = new IntegrationProxyArgs(this); }
private IntegrationProxy(IntegrationProxyArgs args) { IntegrationProxyFactory factory = new IntegrationProxyFactory(); this.Proxy = factory.CreateProxy(args); }