Public Delegate Void UserRequest (Object Sender, Eventargs E); // Define Entrusted Public Event UserRequest OnuserRequest; // This entrustment type type of event
Call: Client (UserInputMonitor m) {m.OnUserRequest = new UserInputMonitor.UserRequest (this.ShowMessage); m.OnUserRequest = new UserRequest (this.ShowMessage2); m.OnUserRequest - = new UserInputMonitor.UserRequest (this.ShowMessage); }
What to do here is to do what you want to do once the event is triggered, just like a linked list. The operation of the list is =, - =