static void Main(string[] args) { UserInputMonitor monitor = new UserInputMonitor(); Client client = new Client(monitor); monitor.Run(); }
public Client(UserInputMonitor m) { m.OnUserRequest += new UserInputMonitor.UserRequest(this.ShowMessage); //m.OnUserRequest+=new m.UserRequest(this.ShowMessage); //注意这种写法是错误的,因为委托是静态的 }