Exemple #1
0
        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");
        }
Exemple #2
0
        public static IntegrationProxy GetInstance(IntegrationProxyArgs args)
        {
            if (_instance == null)
            {
                _instance = new IntegrationProxy(args);
            }

            return(_instance);
        }
Exemple #3
0
 public IntegrationProxyArgsBuilder()
 {
     this.args = new IntegrationProxyArgs(this);
 }
Exemple #4
0
        private IntegrationProxy(IntegrationProxyArgs args)
        {
            IntegrationProxyFactory factory = new IntegrationProxyFactory();

            this.Proxy = factory.CreateProxy(args);
        }