private int ProcessRequest(IntPtr self, IntPtr request, IntPtr callback) { var e = new RequestProcessingEventArgs { Controller = AsyncActivityController.FromHandle(callback), Request = Request.FromHandle(request) }; OnRequestProcessing(e); if (e.IsCanceled) { e.Controller.Cancel(); } else { e.Controller.Continue(); } e.Controller.Dispose(); return e.IsCanceled ? 0 : 1; }
protected virtual void OnRequestProcessing(RequestProcessingEventArgs e) { var handler = ResourceRequested; if (handler != null) { handler(this, e); } }