Пример #1
0
 private void Change(object sender, EventArgs e)
 {
     Color = Color.FromArgb(RedRGBNum.Number, GreenRGBNum.Number, BlueRGBNum.Number);
     ChangeColor?.Invoke(color);
 }
Пример #2
0
 private void redButton_CheckedChanged(object sender, EventArgs e)
 {
     ChangeColor?.Invoke(Color.Red);
 }
Пример #3
0
 private void blueButton_CheckedChanged(object sender, EventArgs e)
 {
     ChangeColor?.Invoke(Color.Blue);
 }
Пример #4
0
 private void greenButton_CheckedChanged(object sender, EventArgs e)
 {
     ChangeColor?.Invoke(Color.Green);
 }
Пример #5
0
 //构造器,默认
 public void OnChange()
 {
     //事件触发方法
     ChangeColor?.Invoke();//C#6语法,?.空值传播运算符
 }
Пример #6
0
 public void Change(string color)
 {
     ColorChangeDelegate?.Invoke(color);
 }