1
public delegate void EventHandler<TEventArgs>(object sender, TEventArgs e);
使用例子:
public event EventHandler<TcpClientKickedEventArgs> ClientKicked; //怎样调用 if(ClientKicked!=null) { ClientKicked(this, new TcpClientKickedEventArgs(client.client)); }
题外话:TcpClientKickedEventArgs的定义
//题外话 public class TcpClientKickedEventArgs:EventArgs { public TcpClientKickedEventArgs(TcpClient tcpClient) { this.TcpClient = tcpClient; } public TcpClient TcpClient { get; private set; } }View Code
标签:ClientKicked,TcpClient,C#,event,delegate,TcpClientKickedEventArgs,public From: https://www.cnblogs.com/noigel/p/18159365