Beispiel #1
0
 public string setCarColour(string colour)
 {
     if (colour != null)
     {
         this.Colour = colour;
         ColourChanged?.Invoke(this, new EventArgs());
     }
     return(colour);
 }
        private void bSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            ResultColour   = Color.FromRgb(ResultColour.R, ResultColour.G, (byte)bSlider.Value);
            bLabel.Content = (byte)bSlider.Value;

            preview.Background = new SolidColorBrush(ResultColour);

            if (ColourChanged != null)
            {
                ColourChanged.Invoke(this, null);
            }
        }
Beispiel #3
0
 /// <summary>
 /// Colour has changed
 /// </summary>
 /// <param name="sender">Sender of event</param>
 /// <param name="e">Event arguments</param>
 private void OnButton1Click(object sender, EventArgs e)
 {
     colorDialog1.Color = button1.BackColor;
     if (colorDialog1.ShowDialog() == DialogResult.OK)
     {
         button1.BackColor = colorDialog1.Color;
         if (ColourChanged != null)
         {
             ColourChanged.Invoke(sender, e);
         }
     }
 }
Beispiel #4
0
 protected void OnColorChanged()
 {
     ColourChanged?.Invoke(this, _eventArgs);
 }
Beispiel #5
0
 private void RaiseColourChanged()
 {
     ColourChanged?.Invoke(this, new ColourEventArgs(Colour));
 }
Beispiel #6
0
 protected virtual void OnColourChanged(object sender, ColourChangedEventArgs e) => ColourChanged?.Invoke(sender, e);