protected virtual void OnTaskStatusChangedHandler(object sender, TaskStatusChangedEventArgs e) { EventHandler <TaskStatusChangedEventArgs> handler = TaskStatusChanged; if (handler != null) { handler(this, e); } gsm.Evaluate(); }
protected virtual void OnStatusChanged(TaskStatusChangedInfo tsci) { AsyncCommandQueue queue = commandQueue; EventHandler <TaskStatusChangedEventArgs> handler = StatusChanged; if (queue != null) { queue.Register(new CommandWrapper(delegate { TaskStatusChangedEventArgs e = new TaskStatusChangedEventArgs(tsci); if (handler != null) { handler(this, e); } })); } else if (handler != null) { ThreadPool.QueueUserWorkItem(delegate { handler(this, new TaskStatusChangedEventArgs(tsci)); }); } }
protected virtual void OnStatusChanged(TaskStatusChangedInfo tsci) { AsyncCommandQueue queue = commandQueue; EventHandler<TaskStatusChangedEventArgs> handler = StatusChanged; if (queue != null) { queue.Register (new CommandWrapper (delegate { TaskStatusChangedEventArgs e = new TaskStatusChangedEventArgs (tsci); if (handler != null) { handler (this, e); } })); } else if (handler != null) { ThreadPool.QueueUserWorkItem (delegate { handler (this, new TaskStatusChangedEventArgs (tsci)); }); } }
private void OnDownloadTaskStatusChangedHandler(object sender, TaskStatusChangedEventArgs e) { if (e.StatusChanged != null) { lock (sync) { TaskStatusChanged (e.StatusChanged); } } else { lock (sync) { foreach (TaskStatusChangedInfo statusInfo in e.StatusesChanged) { TaskStatusChanged (statusInfo); } } } }