示例#1
0
        private Currency toCurrency = Currency.None; // to currency input from the user

        #endregion Fields

        #region Constructors

        //
        // Interface methods
        //
        // constructor - create the conversion engine, initialize the GUI and set up the display
        public GUI()
        {
            conversionEngine = new ConversionEngine(this);

            GUIInitialize();

            updateDisplay();
        }
示例#2
0
        private ConversionEngine conversionEngine = null; // conversion engine instance at construction

        //
        // Interface methods
        //

        // constructor - create the conversion engine, initialize the GUI and set up the display
        public GUI()
        {
            conversionEngine = new ConversionEngine(this);

            GUIInitialize();

            updateDisplay();
        }
示例#3
0
        private static System.Timers.Timer timer;                                        // singleton static timer instance to update all data provider instances

        //
        // Interface methods
        //

        // constructor - save conversion engine reference, make initial primary data request, start the timer (if not already) and add this instance to the list
        public DataProvider(ConversionEngine conversionEngine)
        {
            this.conversionEngine = conversionEngine;

            updateDataQuotes();

            if (timer == null)
            {
                timer          = new System.Timers.Timer(updateMilliseconds);
                timer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimedEvent);
                timer.Enabled  = true;
            }

            dataProviderList.Add(this);
        }
示例#4
0
        private Currency toCurrency = Currency.None; // currency to convert to

        #endregion Fields

        #region Constructors

        //
        // Interface methods
        //
        // constructor - save conversion engine reference, make initial primary data request, start the timer (if not already) and add this instance to the list
        public DataProvider(ConversionEngine conversionEngine)
        {
            this.conversionEngine = conversionEngine;

            updateDataQuotes();

            if (timer == null)
            {
                timer = new System.Timers.Timer(updateMilliseconds);
                timer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimedEvent);
                timer.Enabled = true;
            }

            dataProviderList.Add(this);
        }