Exemple #1
0
        private void cbAutoPoweroffTime_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBoxItem selectedItem = e.AddedItems[0] as ComboBoxItem;

            short numValue = -1;

            bool result = Int16.TryParse(selectedItem.Content as string, out numValue);

            _controller?.SetAutoPowerOffTime(numValue);
        }
Exemple #2
0
        public void TestAutoShutdownTimeSetup()
        {
            bool result = false;

            _controller.AutoPowerOffTimeChanged += (IPenClient sender, SimpleResultEventArgs args) =>
            {
                result = args.Result;
                _autoResetEvent.Set();
            };

            Task.Factory.StartNew(() =>
            {
                _controller.SetAutoPowerOffTime(20);
            });

            _autoResetEvent.WaitOne();

            Assert.IsTrue(result);
        }