bool RunInterceptors() { while (this.index < this.interceptors.Count) { RequestInterceptor interceptor = this.interceptors[this.index]; if (interceptor.IsSynchronous) { interceptor.ProcessRequest(ref this.context); } else { IAsyncResult result = interceptor.BeginProcessRequest(this.context, this.ProcessRequestCallback, null); if (!result.CompletedSynchronously) { return(false); } this.context = interceptor.EndProcessRequest(result); } if (this.context == null) { return(true); } ++this.index; } return(true); }
bool RunInterceptors() { while (this.index < this.interceptors.Count) { RequestContext original = this.context; bool dispose = true; RequestInterceptor interceptor = this.interceptors[this.index]; try { if (interceptor.IsSynchronous) { interceptor.ProcessRequest(ref this.context); dispose = false; } else { IAsyncResult result = interceptor.BeginProcessRequest(this.context, this.ProcessRequestCallback, null); if (!result.CompletedSynchronously) { dispose = false; return(false); } else { this.context = interceptor.EndProcessRequest(result); dispose = false; } } } finally { if (dispose) { original.Abort(); } } if (this.context == null) { return(true); } ++this.index; } return(true); }