示例#1
0
        /// <summary>
        ///     Constructor for Fiat Currency Manager
        /// </summary>
        /// <param name="ecbManager">European Central Bank Manager</param>
        /// <param name="bocManager">Bank of Canada Manager</param>
        /// <param name="fixManager">Fixer Manager</param>
        public FiatManager(EuropeanCentralBankManager ecbManager, BankOfCanadaManager bocManager,
                           FixerManager fixManager)
        {
            this.ecbManager = ecbManager;
            this.bocManager = bocManager;
            this.fixManager = fixManager;

            ecbThread = new Thread(UpdateECBData);

            bocThread = new Thread(UpdateBOCData);

            fixThread = new Thread(UpdateFixData);
        }
示例#2
0
        /// <summary>
        ///     Code that is ran on startup to initialize everything
        /// </summary>
        /// <param name="args"></param>
        private static void StartUp(string[] args)
        {
            Console.Title = "Poseidon";

            Logger.Startup();

            PrintCommandLineInfo(args);

            Logger.WriteLine("Welcome to Poseidon!");

            NETWORK = Utilities.CheckNetworkConnection();
            if (!NETWORK)
            {
                Logger.WriteLine("No network connection!");
                Utilities.ExitProgram(true);
            }

            Settings.Startup(args);
            Database.Startup();

            ecbManager = new EuropeanCentralBankManager();
            bocManager = new BankOfCanadaManager();
            fixManager = new FixerManager();
            fiat       = new FiatManager(ecbManager, bocManager, fixManager);


            krakenManager = new KrakenManager();

            cryptoThread = new Thread(UpdateCryptoData);
            cryptoThread.Start();

            networkThread = new Thread(UpdateNetworkStatus);
            networkThread.Start();

            fiat.StartThreads();

            // Sleep main thread for 2000 milliseconds to allow data collection threads to get data
            Thread.Sleep(2000);
        }