/// <summary> /// HttpServerHelper类构造函数 /// </summary> /// <param name="port">端口</param> /// <param name="doWork">HTTP请求处理方法</param> /// <param name="exceptionHandle">错误回调方法</param> public HttpServer(int port, DelegateDoWork doWork, DelegateException exceptionHandle) { this._port = port; this.DoWork = doWork; this.OnException = exceptionHandle; }
/// <summary> /// HttpServerHelper类构造函数 /// </summary> /// <param name="port">端口</param> /// <param name="doWork">HTTP请求处理方法</param> /// <param name="exBack">错误回调方法</param> public HttpServer(int port, DelegateDoWork doWork, DelegateException exBack) { this.Port = port; this.DoWork = doWork; this.ExBack = exBack; }
static void Main(string[] args) { DelegateException obj = new DelegateException(S9.One); // Delegate instantiation obj += S9.Two; Delegate[] del = obj.GetInvocationList(); foreach (DelegateException d in del) { try { d(); } catch (Exception) { Console.WriteLine("Error caught"); } } Console.Read(); }