Example #1
0
        private void OnColorComponentChanged(NormalComponent colorPlaneColorComponent)
        {
            if (colorPlaneColorComponent.Name == "RGB_Red")
            {
                rR.IsChecked = true;
            }
            else if (colorPlaneColorComponent.Name == "RGB_Green")
            {
                rG.IsChecked = true;
            }
            else if (colorPlaneColorComponent.Name == "RGB_Blue")
            {
                rB.IsChecked = true;
            }
            else
            {
                rR.IsChecked = false;
                rG.IsChecked = false;
                rB.IsChecked = false;
            }

            if (ColorComponentChanged != null)
            {
                ColorComponentChanged(this, new EventArgs <NormalComponent>(colorPlaneColorComponent));
            }
        }
Example #2
0
        private void OnColorChanged(Color color)
        {
            if (mColorChangeSource == EColorChangeSource.ColorPropertySet)
            {
                UpdateColorPlaneBitmap(NormalComponent.Value(color));
                SelectionPoint       = NormalComponent.PointFromColor(color);
                selectionTransform.X = SelectionPoint.X - (mSelectionPane.PixelWidth / 2.0);
                selectionTransform.Y = SelectionPoint.Y - (mSelectionPane.PixelHeight / 2.0);


                sNormal.Value = NormalComponent.Value(color);

                if (!NormalComponent.IsNormalIndependantOfColor)
                {
                    NormalComponent.UpdateNormalBitmap(mNormalPane, color);
                }
            }

            if (SelectionRingMode == ESelectionRingMode.BlackOrWhite)
            {
                AdjustSelectionRing(color);
            }
            if (ColorChanged != null)
            {
                ColorChanged(this, new EventArgs <Color>(color));
            }
        }
Example #3
0
        private void OnColorComponentChanged(NormalComponent colorPlaneColorComponent)
        {
            if (colorPlaneColorComponent.Name == "HSB_Hue")
            {
                rH.IsChecked = true;
            }
            else if (colorPlaneColorComponent.Name == "HSB_Saturation")
            {
                rS.IsChecked = true;
            }
            else if (colorPlaneColorComponent.Name == "HSB_Brightness")
            {
                rB.IsChecked = true;
            }
            else
            {
                rH.IsChecked = false;
                rS.IsChecked = false;
                rB.IsChecked = false;
            }

            if (ColorComponentChanged != null)
            {
                ColorComponentChanged(this, new EventArgs <NormalComponent>(colorPlaneColorComponent));
            }
        }
Example #4
0
 private void OnColorComponentChanged(NormalComponent colorPlaneColorComponent)
 {
     if (ColorComponentChanged != null)
     {
         ColorComponentChanged(this, new EventArgs <NormalComponent>(colorPlaneColorComponent));
     }
 }
        public void ViewComponentBuilderWithConstructorWithViewComponentShouldNotBeNull()
        {
            var viewComponent        = new NormalComponent();
            var viewComponentBuilder = new MyViewComponent <NormalComponent>(viewComponent);

            Assert.NotNull(viewComponentBuilder);
            Assert.IsAssignableFrom <NormalComponent>(viewComponentBuilder.TestContext.Component);
        }
Example #6
0
 private void rB_Checked(object sender, RoutedEventArgs e)
 {
     NormalComponent = sBlue;
     if (ColorComponentChanged != null)
     {
         ColorComponentChanged(this, new EventArgs <NormalComponent>(sBlue));
     }
 }
Example #7
0
 private void UpdateColorPlaneBitmap(int colorComponentValue)
 {
     if (lastColorComponentValue != colorComponentValue || lastComponentName != NormalComponent.Name)
     {
         NormalComponent.UpdateColorPlaneBitmap(mSelectionPane, colorComponentValue);
         lastColorComponentValue = colorComponentValue;
         lastComponentName       = NormalComponent.Name;
     }
 }
        public void ViewComponentWithProvidedInstanceShouldPopulateCorrectInstanceOfViewComponentType()
        {
            var instance = new NormalComponent();

            MyViewComponent<NormalComponent>
                .Instance(instance)
                .ShouldPassForThe<NormalComponent>(viewComponent =>
                {
                    Assert.NotNull(viewComponent);
                    Assert.IsAssignableFrom<NormalComponent>(viewComponent);
                });
        }
Example #9
0
 private void sNormal_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
 {
     mColorChangeSource = EColorChangeSource.SliderMove;
     if (ProcessSliderEvents)
     {
         ProcessSliderEvents = false;
         Color = NormalComponent.ColorAtPoint(SelectionPoint, (int)e.NewValue);
         UpdateColorPlaneBitmap(NormalComponent.Value(Color));
         ProcessSliderEvents = true;
     }
     mColorChangeSource = EColorChangeSource.ColorPropertySet;
 }
Example #10
0
        public void ViewComponentWithProvidedInstanceShouldPopulateCorrectInstanceOfViewComponentType()
        {
            var instance = new NormalComponent();

            MyViewComponent <NormalComponent>
            .Instance(instance)
            .ShouldPassForThe <NormalComponent>(viewComponent =>
            {
                Assert.NotNull(viewComponent);
                Assert.IsAssignableFrom <NormalComponent>(viewComponent);
            });
        }
Example #11
0
 private void OnNormalComponentChanged(NormalComponent cc)
 {
     SelectionPoint       = cc.PointFromColor(Color);
     selectionTransform.X = SelectionPoint.X - (colorPlane.ActualWidth / 2);
     selectionTransform.Y = SelectionPoint.Y - (colorPlane.ActualHeight / 2);
     ProcessSliderEvents  = false;
     sNormal.Minimum      = cc.MinValue;
     sNormal.Maximum      = cc.MaxValue;
     sNormal.Value        = cc.Value(Color);
     ProcessSliderEvents  = true;
     cc.UpdateNormalBitmap(mNormalPane, Color);
     cc.UpdateColorPlaneBitmap(mSelectionPane, cc.Value(Color));
 }
Example #12
0
        private void ProcessMousedown(Point selectionPoint)
        {
            SelectionPoint       = selectionPoint;
            selectionTransform.X = SelectionPoint.X - (colorPlane.ActualWidth / 2);
            selectionTransform.Y = SelectionPoint.Y - (colorPlane.ActualHeight / 2);
            var newColor = NormalComponent.ColorAtPoint(SelectionPoint, (int)sNormal.Value);

            if (!NormalComponent.IsNormalIndependantOfColor)
            {
                NormalComponent.UpdateNormalBitmap(mNormalPane, newColor);
            }
            Color = newColor;
        }
Example #13
0
		private void OnColorComponentChanged(NormalComponent colorPlaneColorComponent) {
			if (colorPlaneColorComponent.Name == "HSB_Hue") {
				rH.IsChecked = true;
			} else if (colorPlaneColorComponent.Name == "HSB_Saturation") {
				rS.IsChecked = true;
			} else if (colorPlaneColorComponent.Name == "HSB_Brightness") {
				rB.IsChecked = true;
			} else {
				rH.IsChecked = false;
				rS.IsChecked = false;
				rB.IsChecked = false;
			}

			if (ColorComponentChanged != null)
				ColorComponentChanged(this, new EventArgs<NormalComponent>(colorPlaneColorComponent));
		}
Example #14
0
 private void OnColorComponentChanged(NormalComponent colorPlaneColorComponent)
 {
     if (colorPlaneColorComponent.Name == "LAB_Lightness")
     {
         rL.IsChecked = true;
     }
     else if (colorPlaneColorComponent.Name == "LAB_A")
     {
         rA.IsChecked = true;
     }
     else if (colorPlaneColorComponent.Name == "LAB_B")
     {
         rB.IsChecked = true;
     }
     else
     {
         rL.IsChecked = false;
         rA.IsChecked = false;
         rB.IsChecked = false;
     }
 }
Example #15
0
 private void OnColorComponentChanged(NormalComponent colorPlaneColorComponent)
 {
     if (colorPlaneColorComponent.Name == "LAB_Lightness")
     {
         rL.IsChecked = true;
     }
     else if (colorPlaneColorComponent.Name == "LAB_A")
     {
         rA.IsChecked = true;
     }
     else if (colorPlaneColorComponent.Name == "LAB_B")
     {
         rB.IsChecked = true;
     }
     else
     {
         rL.IsChecked = false;
         rA.IsChecked = false;
         rB.IsChecked = false;
     }
 }
Example #16
0
        private void OnColorComponentChanged(NormalComponent colorPlaneColorComponent)
        {
            if (colorPlaneColorComponent.Name == "RGB_Red")
            {
                 rR.IsChecked = true;
            }
            else if (colorPlaneColorComponent.Name == "RGB_Green")
            {
                 rG.IsChecked = true;
            }
            else if (colorPlaneColorComponent.Name == "RGB_Blue")
            {
                rB.IsChecked = true;
            }
            else
            {
                rR.IsChecked = false;
                rG.IsChecked = false;
                rB.IsChecked = false;
            }

            if (ColorComponentChanged != null)
            {
                ColorComponentChanged(this, new EventArgs<NormalComponent>(colorPlaneColorComponent));
            }
        }
Example #17
0
 private void rR_Checked(object sender, RoutedEventArgs e)
 {
     NormalComponent = sRed;
     if (ColorComponentChanged != null)
     {
         ColorComponentChanged(this, new EventArgs<NormalComponent>(sRed));
     }
 }
Example #18
0
		private void rS_Checked(object sender, RoutedEventArgs e) {
			NormalComponent = sSaturation;
		}
Example #19
0
 private void rB_Checked(object sender, RoutedEventArgs e)
 {
     NormalComponent = sB;
 }
Example #20
0
 private void rS_Checked(object sender, RoutedEventArgs e)
 {
     NormalComponent = sSaturation;
 }
Example #21
0
 private void rB_Checked(object sender, RoutedEventArgs e)
 {
     NormalComponent = sBrightness;
 }
Example #22
0
 private void rL_Checked(object sender, RoutedEventArgs e)
 {
     NormalComponent = sLightness;
 }
Example #23
0
 private void rH_Checked(object sender, RoutedEventArgs e)
 {
     NormalComponent = sHue;
 }