public void Run() { if (WantSingleValue != null) { var args = new SingleValueEventArgs(); WantSingleValue(this, args); Console.WriteLine("Last handler produced " + args.Value.ToString()); } if (WantMultipleValues != null) { var args = new MultiValueEventArgs(); WantMultipleValues(this, args); foreach (var value in args.Values) { Console.WriteLine("A handler produced " + value.ToString()); } } }
void exposer_WantSingleValue(object sender, SingleValueEventArgs e) { Console.WriteLine("Handler assigning " + _value.ToString()); e.Value = _value; }