internal void Start(PageAsyncTaskManager manager, object source, EventArgs args) { this._taskManager = manager; this._completionCallback = new AsyncCallback(this.OnAsyncTaskCompletion); this._started = true; try { IAsyncResult result = this._beginHandler(source, args, this._completionCallback, this._state); if (result == null) { throw new InvalidOperationException(System.Web.SR.GetString("Async_null_asyncresult")); } if (this._asyncResult == null) { this._asyncResult = result; } } catch (Exception exception) { this._error = exception; this._completed = true; this._completedSynchronously = true; this._taskManager.TaskCompleted(true); } }
internal void Start(PageAsyncTaskManager manager, object source, EventArgs args) { this._taskManager = manager; this._completionCallback = new AsyncCallback(this.OnAsyncTaskCompletion); this._started = true; try { IAsyncResult result = this._beginHandler(source, args, this._completionCallback, this._state); if (result == null) { throw new InvalidOperationException(System.Web.SR.GetString("Async_null_asyncresult")); } if (this._asyncResult == null) { this._asyncResult = result; } } catch (Exception exception) { this._error = exception; this._completed = true; this._completedSynchronously = true; this._taskManager.TaskCompleted(true); } }
public void RegisterAsyncTask(PageAsyncTask task) { if (task == null) { throw new ArgumentNullException("task"); } if (this._asyncTaskManager == null) { this._asyncTaskManager = new PageAsyncTaskManager(this); } this._asyncTaskManager.AddTask(task); }