//专门触发事件的方法,定义为OnEvent(); public void OnAction() { //必须判断这个委托是不是为空。 if (this.actionEventHandler != null) { Console.WriteLine("++++++++++++++"); ActioneEventArgs e = new ActioneEventArgs() { DishName = "Chicken" }; this.actionEventHandler.Invoke(this, e); } }
internal void Action(Customer customer, ActioneEventArgs e) { Console.WriteLine("---------------"); }