/// <summary> /// Adds the given <see cref="IBackgroundTask"/> to the view's list. If the <see cref="IBackgroundTask"/> /// already exists in the list, nothing is done. /// </summary> /// <param name="p_tskTask">The <see cref="IBackgroundTask"/> to add to the view's list.</param> protected void AddTaskToList(AddModTask p_tskTask) { foreach (DownloadListViewItem lviExisitingDownload in lvwTasks.Items) { if (lviExisitingDownload.Task == p_tskTask) { return; } } p_tskTask.PropertyChanged -= new PropertyChangedEventHandler(Task_PropertyChanged); p_tskTask.PropertyChanged += new PropertyChangedEventHandler(Task_PropertyChanged); DownloadListViewItem lviDownload = new DownloadListViewItem(p_tskTask); lvwTasks.Items.Add(lviDownload); }
/// <summary> /// Adds the given <see cref="IBackgroundTask"/> to the view's list. If the <see cref="IBackgroundTask"/> /// already exists in the list, nothing is done. /// </summary> /// <param name="p_tskTask">The <see cref="IBackgroundTask"/> to add to the view's list.</param> protected void AddTaskToList(AddModTask p_tskTask) { foreach (DownloadListViewItem lviExisitingDownload in lvwTasks.Items) if (lviExisitingDownload.Task == p_tskTask) return; p_tskTask.PropertyChanged -= new PropertyChangedEventHandler(Task_PropertyChanged); p_tskTask.PropertyChanged += new PropertyChangedEventHandler(Task_PropertyChanged); DownloadListViewItem lviDownload = new DownloadListViewItem(p_tskTask); lvwTasks.Items.Add(lviDownload); }