Ejemplo n.º 1
0
        public Window1()
        {
            InitializeComponent();
            settings = (MyPowerSettings)this.FindResource("powerSettings");

            backgroundWorker.WorkerReportsProgress      = true;
            backgroundWorker.WorkerSupportsCancellation = true;
            backgroundWorker.DoWork             += new DoWorkEventHandler(backgroundWorker_DoWork);
            backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker_RunWorkerCompleted);

            // Start a timer/clock so we can periodically ping for the power settings.
            TimerClock           = new DispatcherTimer();
            TimerClock.Interval  = new TimeSpan(0, 0, 5);
            TimerClock.IsEnabled = true;
            TimerClock.Tick     += new EventHandler(TimerClock_Tick);
        }
Ejemplo n.º 2
0
        public Window1()
        {
            InitializeComponent();
            settings = (MyPowerSettings)this.FindResource("powerSettings");

            backgroundWorker.WorkerReportsProgress = true;
            backgroundWorker.WorkerSupportsCancellation = true;
            backgroundWorker.DoWork += new DoWorkEventHandler(backgroundWorker_DoWork);
            backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker_RunWorkerCompleted);
            
            // Start a timer/clock so we can periodically ping for the power settings.
            TimerClock = new DispatcherTimer();
            TimerClock.Interval = new TimeSpan(0, 0, 5);
            TimerClock.IsEnabled = true;
            TimerClock.Tick += new EventHandler(TimerClock_Tick);

        }