示例#1
0
        private void cbColor_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var color = cbColor.SelectedItem as NColor;

            if (color == null)
            {
                return;
            }
            _controller?.SetColor(color.Color);
            _color = color.RealColor;
        }
示例#2
0
        public void TestPenColorSetup()
        {
            bool result = false;

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

            Task.Factory.StartNew(() =>
            {
                _controller.SetColor(0x00000000);
            });

            _autoResetEvent.WaitOne();

            Assert.IsTrue(result);
        }