Ejemplo n.º 1
0
 public ModuleContext(DateTime time, Location2 location, ITransferManager transferManager, IMarket market, IItemStore itemStore)
 {
     Time = time;
     Location = location;
     TransferManager = transferManager;
     Market = market;
     ItemStore = itemStore;
 }
Ejemplo n.º 2
0
 public HomeController(ILogger <HomeController> logger,
                       IUserManager userManager,
                       IAccountManager accountManager,
                       ITransferManager trnxManager)
 {
     _logger         = logger;
     _userManager    = userManager;
     _accountManager = accountManager;
     _trnxManager    = trnxManager;
 }
 public Airtime(IVendorsManager _vendorsManager,
                IEnumerable <IAirtimeService> _airtimeServices,
                ITransferService _transferService,
                ITransferManager _transferManager, ILogger <Airtime> Alogger) : base(Guid.NewGuid())
 {
     Vendors         = new Vendors(_vendorsManager);
     airtimeServices = _airtimeServices;
     transferService = _transferService;
     transferManager = _transferManager;
     _logger         = Alogger;
 }
Ejemplo n.º 4
0
 public Data(IDatapackageManager datapackageManager,
             ITransferService _transferService,
             IVendorsManager vendorsManager,
             IEnumerable <IAirtimeService> _airtimeServices, ITransferManager _transferManager) : base(Guid.NewGuid())
 {
     transferService = _transferService;
     _DataPackages   = new DataPackages(datapackageManager);
     Vendors         = new Vendors(vendorsManager);
     airtimeServices = _airtimeServices;
     transferManager = _transferManager;
 }
Ejemplo n.º 5
0
        public Sector(int id, Location2 location, ITransferManager transferManager)
        {
            _commodityProducers = new List<ICommodityProducer>();
            _shardModules = new List<IGameModule>();

            _transferManager = transferManager;

            Id = id;
            Location = location;

            InitModuleItemStores();
        }
Ejemplo n.º 6
0
 public SyncServiceControl()
 {
     _transferManager = IoC.Resolve<ITransferManager>();
 }
Ejemplo n.º 7
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Initializing log");
            log4net.Config.XmlConfigurator.Configure();
            var log = log4net.LogManager.GetLogger(typeof(Program));

            log.InfoFormat("Log initialized");

            log.InfoFormat("Initializing IoC container");
            using (UnityContainer container = new UnityContainer())
            {
                log.InfoFormat("Loading IoC container configuration");
                container.LoadConfiguration();
                container.AddNewExtension <Log4NetExtension>();
                DependencyResolver.Container = container;
                log.InfoFormat("IoC container initialized");

                log.InfoFormat("Checking input arguments");
                Parser.Default.ParseArguments <Options>(args)
                .WithParsed <Options>(o =>
                {
                    Program._transferManager   = o.TransferManager;
                    _transferManagerParameters = o.TransferManagerParameter;
                    _inputPlugin            = o.InputPlugin;
                    _inputPluginParameters  = o.InputPluginParameters;
                    _outputPlugin           = o.OutputPlugin;
                    _outputPluginParameters = o.OutputPluginParameters;

                    if (o.Verbose)
                    {
                        Console.WriteLine($"Current Arguments: -t {o.TransferManager} -tp {o.TransferManagerParameter} -i {o.InputPlugin} -ip {o.InputPluginParameters} " +
                                          $"-o {o.OutputPlugin} -op {o.OutputPluginParameters}");
                        Console.WriteLine();
                    }
                    else
                    {
                    }
                });

                try
                {
                    CheckParameters();
                    CheckIfRegistered(container);
                    log.Info("Plugins and manager initializing started");
                    using (var inputPluginInstance = container.Resolve <IInputPlugin>(_inputPlugin))
                    {
                        try
                        {
                            inputPluginInstance.Init(_inputPluginParameters);
                        }
                        catch (Exception)
                        {
                            //log.Erro
                            log.Info(inputPluginInstance.GetHelp());
                            throw new InputParametersNotFoundException();
                        }

                        using (var outputPluginInstance = container.Resolve <IOutputPlugin>(_outputPlugin))
                        {
                            try
                            {
                                outputPluginInstance.Init(_outputPluginParameters);
                            }
                            catch (Exception)
                            {
                                log.Info(outputPluginInstance.GetHelp());
                                throw new InputParametersNotFoundException();
                            }

                            using (ITransferManager transferManagerInstance = container.Resolve <ITransferManager>(_transferManager))
                            {
                                try
                                {
                                    transferManagerInstance.Init(_transferManagerParameters);
                                }
                                catch (Exception)
                                {
                                    log.Info(transferManagerInstance.GetHelp());
                                    throw new InputParametersNotFoundException();
                                }
                                transferManagerInstance.Transfer(inputPluginInstance, outputPluginInstance);
                            }
                        }
                    }
                }
                catch (InputParametersNotFoundException e)
                {
                    log.Error(e.Message);
                }
                catch (FilePathException e)
                {
                    log.Error(e.Message);
                }
                catch (SqlException e)
                {
                    log.Error(e.Message);
                }
                catch (InvalidConnectionStringException e)
                {
                    log.Error(e.Message);
                }
                catch (InvalidPluginException e)
                {
                    log.Error(e.Message);
                }
                catch (ArgumentNullException e)
                {
                    log.Error(e.Message);
                }
                catch (ArgumentException e)
                {
                    log.Error(e.Message);
                }
                catch (Exception e)
                {
                    log.Error(e.Message);
                }

                log.InfoFormat("Press any key to exit");
                Console.ReadKey();
            }
        }
 public TransferFunds(ITransferService _transferService, ITransferManager _transferManager)
 {
     transferService = _transferService;
     transferManager = _transferManager;
 }
 /// <summary>
 /// Sets the cached runner. This is mainly for testing purpose.
 /// </summary>
 /// <param name="runner">
 /// Indicating the instance of the cached runner.
 /// </param>
 internal static void SetCachedTransferManager(ITransferManager transferManager)
 {
     cachedTransferManager = transferManager;
 }
Ejemplo n.º 10
0
        private IList<ISector> GetSectors(int clusterId, ITransferManager transferManager)
        {
            List<ISector> sectors = new List<ISector>();

            sectors.Add(new Sector(1, new Location2("EastCoastAmerica", 1, 1), transferManager));

            return sectors;
        }
Ejemplo n.º 11
0
 /// <summary>
 /// Sets the cached runner. This is mainly for testing purpose.
 /// </summary>
 /// <param name="runner">
 /// Indicating the instance of the cached runner.
 /// </param>
 internal static void SetCachedTransferManager(ITransferManager transferManager)
 {
     cachedTransferManager = transferManager;
 }