コード例 #1
0
        public void TestThatPropertyChangeCalled(string prop, byte value)
        {
            NotifyableColor color    = new NotifyableColor(Colors.Black);
            var             property = color.GetType().GetProperty(prop);

            Assert.NotNull(property);
            Assert.PropertyChanged(color, prop, () => property.SetValue(color, value));
        }
コード例 #2
0
ファイル: ColorPicker.xaml.cs プロジェクト: Wappen/PixiEditor
 public ColorPicker()
 {
     InitializeComponent();
     _colorPalette   = FindName("colorPalette") as Image;
     _dispatcher     = Application.Current.Dispatcher;
     NotifyableColor = new NotifyableColor(SelectedColor);
     NotifyableColor.ColorChanged   += SelectedColor_ColorChanged;
     _colorPalette.IsVisibleChanged += _colorPalette_IsVisibleChanged;
 }
コード例 #3
0
        public void TestThatSetArgbWorks()
        {
            NotifyableColor color = new NotifyableColor();

            color.SetArgb(2, 2, 2, 2);
            Assert.Equal(2, color.A);
            Assert.Equal(2, color.R);
            Assert.Equal(2, color.G);
            Assert.Equal(2, color.B);
        }
コード例 #4
0
        public void TestThatEventCalled(string prop, byte value)
        {
            bool            eventCalled = false;
            NotifyableColor color       = new NotifyableColor(Colors.Black);
            var             property    = color.GetType().GetProperty(prop);

            color.ColorChanged += (s, e) => eventCalled = true;
            Assert.NotNull(property);

            property.SetValue(color, value);

            Assert.True(eventCalled);
        }