コード例 #1
0
ファイル: GUI.xaml.cs プロジェクト: cdevault/cmsc495g4
        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
ファイル: GUI.xaml.cs プロジェクト: cmsc495g4/cmsc495g4
        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
ファイル: DataProvider.cs プロジェクト: cdevault/cmsc495g4
        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);
        }