public void CallUpdateBottomBarFeedback(ActivateModsListViewItem p_ActivateModList) { UpdateBottomBarFeedback(p_ActivateModList, new EventArgs()); }
/// <summary> /// Adds the given <see cref="BasicInstallTask"/> to the view's list. If the <see cref="BasicInstallTask"/> /// already exists in the list, nothing is done. /// </summary> /// <param name="p_tskTask">The <see cref="BasicInstallTask"/> to add to the view's list.</param> protected void AddTaskToList(IBackgroundTaskSet p_tskTask) { foreach (ActivateModsListViewItem lviExisitingTask in lvwActiveTasks.Items) { if (lviExisitingTask.Task == p_tskTask) { return; } } if (m_btsRunningTask != null) { if (p_tskTask.GetType() == typeof(ModInstaller)) { foreach (IBackgroundTaskSet iBk in QueuedTasks) { if (iBk.GetType() == typeof(ModInstaller)) { if (((ModInstaller)iBk).ModFileName == ((ModInstaller)p_tskTask).ModFileName) { if (((ModInstaller)iBk).IsQueued) { booQueued = true; } } } else if (iBk.GetType() == typeof(ModUninstaller)) { if (((ModUninstaller)iBk).ModFileName == ((ModInstaller)p_tskTask).ModFileName) { if (((ModUninstaller)iBk).IsQueued) { booQueued = true; } } } else if (iBk.GetType() == typeof(ModUpgrader)) { if (((ModUpgrader)iBk).ModFileName == ((ModInstaller)p_tskTask).ModFileName) { if (((ModUpgrader)iBk).IsQueued) { booQueued = true; } } } } if (m_btsRunningTask.GetType() == typeof(ModInstaller)) { if ((((ModInstaller)m_btsRunningTask).ModFileName == ((ModInstaller)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTask(((ModInstaller)p_tskTask)); return; } } else if (m_btsRunningTask.GetType() == typeof(ModUninstaller)) { if ((((ModUninstaller)m_btsRunningTask).ModFileName == ((ModInstaller)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTask(((ModInstaller)p_tskTask)); return; } } else if (m_btsRunningTask.GetType() == typeof(ModUpgrader)) { if ((((ModUpgrader)m_btsRunningTask).ModFileName == ((ModInstaller)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTask(((ModInstaller)p_tskTask)); return; } } } else if (p_tskTask.GetType() == typeof(ModUninstaller)) { foreach (IBackgroundTaskSet iBk in QueuedTasks) { if (iBk.GetType() == typeof(ModInstaller)) { if (((ModInstaller)iBk).ModFileName == ((ModUninstaller)p_tskTask).ModFileName) { if (((ModInstaller)iBk).IsQueued) { booQueued = true; } } } else if (iBk.GetType() == typeof(ModUninstaller)) { if (((ModUninstaller)iBk).ModFileName == ((ModUninstaller)p_tskTask).ModFileName) { if (((ModUninstaller)iBk).IsQueued) { booQueued = true; } } } else if (iBk.GetType() == typeof(ModUpgrader)) { if (((ModUpgrader)iBk).ModFileName == ((ModUninstaller)p_tskTask).ModFileName) { if (((ModUpgrader)iBk).IsQueued) { booQueued = true; } } } } if (m_btsRunningTask.GetType() == typeof(ModInstaller)) { if ((((ModInstaller)m_btsRunningTask).ModFileName == ((ModUninstaller)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTaskUn(((ModUninstaller)p_tskTask)); return; } } else if (m_btsRunningTask.GetType() == typeof(ModUninstaller)) { if ((((ModUninstaller)m_btsRunningTask).ModFileName == ((ModUninstaller)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTaskUn(((ModUninstaller)p_tskTask)); return; } } else if (m_btsRunningTask.GetType() == typeof(ModUpgrader)) { if ((((ModUpgrader)m_btsRunningTask).ModFileName == ((ModUninstaller)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTaskUn(((ModUninstaller)p_tskTask)); return; } } } else if (p_tskTask.GetType() == typeof(ModUpgrader)) { foreach (IBackgroundTaskSet iBk in QueuedTasks) { if (iBk.GetType() == typeof(ModInstaller)) { if (((ModInstaller)iBk).ModFileName == ((ModUpgrader)p_tskTask).ModFileName) { if (((ModInstaller)iBk).IsQueued) { booQueued = true; } } } else if (iBk.GetType() == typeof(ModUninstaller)) { if (((ModUninstaller)iBk).ModFileName == ((ModUpgrader)p_tskTask).ModFileName) { if (((ModUninstaller)iBk).IsQueued) { booQueued = true; } } } else if (iBk.GetType() == typeof(ModUpgrader)) { if (((ModUpgrader)iBk).ModFileName == ((ModUpgrader)p_tskTask).ModFileName) { if (((ModUpgrader)iBk).IsQueued) { booQueued = true; } } } } if (m_btsRunningTask.GetType() == typeof(ModInstaller)) { if ((((ModInstaller)m_btsRunningTask).ModFileName == ((ModUpgrader)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTaskUpg(((ModUpgrader)p_tskTask)); return; } } else if (m_btsRunningTask.GetType() == typeof(ModUninstaller)) { if ((((ModUninstaller)m_btsRunningTask).ModFileName == ((ModUpgrader)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTaskUpg(((ModUpgrader)p_tskTask)); return; } } else if (m_btsRunningTask.GetType() == typeof(ModUpgrader)) { if ((((ModUpgrader)m_btsRunningTask).ModFileName == ((ModUpgrader)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTaskUpg(((ModUpgrader)p_tskTask)); return; } } } } p_tskTask.TaskSetCompleted += new EventHandler <TaskSetCompletedEventArgs>(TaskSet_TaskSetCompleted); ActivateModsListViewItem lviActivation = new ActivateModsListViewItem(p_tskTask, this); lvwActiveTasks.Items.Add(lviActivation); if ((m_btsRunningTask == null) || (m_btsRunningTask.IsCompleted)) { m_btsRunningTask = p_tskTask; if (m_btsRunningTask.GetType() == typeof(ModInstaller)) { ((ModInstaller)m_btsRunningTask).Install(); } else if (m_btsRunningTask.GetType() == typeof(ModUninstaller)) { ((ModUninstaller)m_btsRunningTask).Install(); } else if (m_btsRunningTask.GetType() == typeof(ModUpgrader)) { ((ModUpgrader)m_btsRunningTask).Install(); } } else { QueuedTasks.Add(p_tskTask); } }
/// <summary> /// Adds the given <see cref="BasicInstallTask"/> to the view's list. If the <see cref="BasicInstallTask"/> /// already exists in the list, nothing is done. /// </summary> /// <param name="p_tskTask">The <see cref="BasicInstallTask"/> to add to the view's list.</param> protected void AddTaskToList(IBackgroundTaskSet p_tskTask) { foreach (ActivateModsListViewItem lviExisitingTask in lvwActiveTasks.Items) if (lviExisitingTask.Task == p_tskTask) return; if (ViewModel.RunningTask != null) { if (p_tskTask.GetType() == typeof(ModInstaller)) { foreach (IBackgroundTaskSet iBk in QueuedTasks) { if (iBk.GetType() == typeof(ModInstaller)) { if (((ModInstaller)iBk).ModFileName == ((ModInstaller)p_tskTask).ModFileName) if (((ModInstaller)iBk).IsQueued) booQueued = true; } else if (iBk.GetType() == typeof(ModUninstaller)) { if (((ModUninstaller)iBk).ModFileName == ((ModInstaller)p_tskTask).ModFileName) if (((ModUninstaller)iBk).IsQueued) booQueued = true; } else if (iBk.GetType() == typeof(ModUpgrader)) { if (((ModUpgrader)iBk).ModFileName == ((ModInstaller)p_tskTask).ModFileName) if (((ModUpgrader)iBk).IsQueued) booQueued = true; } } if (ViewModel.RunningTask.GetType() == typeof(ModInstaller)) { if ((((ModInstaller)ViewModel.RunningTask).ModFileName == ((ModInstaller)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTask(((ModInstaller)p_tskTask)); return; } } else if (ViewModel.RunningTask.GetType() == typeof(ModUninstaller)) { if ((((ModUninstaller)ViewModel.RunningTask).ModFileName == ((ModInstaller)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTask(((ModInstaller)p_tskTask)); return; } } else if (ViewModel.RunningTask.GetType() == typeof(ModUpgrader)) { if ((((ModUpgrader)ViewModel.RunningTask).ModFileName == ((ModInstaller)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTask(((ModInstaller)p_tskTask)); return; } } } else if(p_tskTask.GetType() == typeof(ModUninstaller)) { foreach (IBackgroundTaskSet iBk in QueuedTasks) { if (iBk.GetType() == typeof(ModInstaller)) { if (((ModInstaller)iBk).ModFileName == ((ModUninstaller)p_tskTask).ModFileName) if (((ModInstaller)iBk).IsQueued) booQueued = true; } else if (iBk.GetType() == typeof(ModUninstaller)) { if (((ModUninstaller)iBk).ModFileName == ((ModUninstaller)p_tskTask).ModFileName) if (((ModUninstaller)iBk).IsQueued) booQueued = true; } else if (iBk.GetType() == typeof(ModUpgrader)) { if (((ModUpgrader)iBk).ModFileName == ((ModUninstaller)p_tskTask).ModFileName) if (((ModUpgrader)iBk).IsQueued) booQueued = true; } } if (ViewModel.RunningTask.GetType() == typeof(ModInstaller)) { if ((((ModInstaller)ViewModel.RunningTask).ModFileName == ((ModUninstaller)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTaskUn(((ModUninstaller)p_tskTask)); return; } } else if (ViewModel.RunningTask.GetType() == typeof(ModUninstaller)) { if ((((ModUninstaller)ViewModel.RunningTask).ModFileName == ((ModUninstaller)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTaskUn(((ModUninstaller)p_tskTask)); return; } } else if (ViewModel.RunningTask.GetType() == typeof(ModUpgrader)) { if ((((ModUpgrader)ViewModel.RunningTask).ModFileName == ((ModUninstaller)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTaskUn(((ModUninstaller)p_tskTask)); return; } } } else if (p_tskTask.GetType() == typeof(ModUpgrader)) { foreach (IBackgroundTaskSet iBk in QueuedTasks) { if (iBk.GetType() == typeof(ModInstaller)) { if (((ModInstaller)iBk).ModFileName == ((ModUpgrader)p_tskTask).ModFileName) if (((ModInstaller)iBk).IsQueued) booQueued = true; } else if (iBk.GetType() == typeof(ModUninstaller)) { if (((ModUninstaller)iBk).ModFileName == ((ModUpgrader)p_tskTask).ModFileName) if (((ModUninstaller)iBk).IsQueued) booQueued = true; } else if (iBk.GetType() == typeof(ModUpgrader)) { if (((ModUpgrader)iBk).ModFileName == ((ModUpgrader)p_tskTask).ModFileName) if (((ModUpgrader)iBk).IsQueued) booQueued = true; } } if (ViewModel.RunningTask.GetType() == typeof(ModInstaller)) { if ((((ModInstaller)ViewModel.RunningTask).ModFileName == ((ModUpgrader)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTaskUpg(((ModUpgrader)p_tskTask)); return; } } else if (ViewModel.RunningTask.GetType() == typeof(ModUninstaller)) { if ((((ModUninstaller)ViewModel.RunningTask).ModFileName == ((ModUpgrader)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTaskUpg(((ModUpgrader)p_tskTask)); return; } } else if (ViewModel.RunningTask.GetType() == typeof(ModUpgrader)) { if ((((ModUpgrader)ViewModel.RunningTask).ModFileName == ((ModUpgrader)p_tskTask).ModFileName) || booQueued) { booQueued = false; m_vmlViewModel.RemoveUselessTaskUpg(((ModUpgrader)p_tskTask)); return; } } } } p_tskTask.TaskSetCompleted += new EventHandler<TaskSetCompletedEventArgs>(TaskSet_TaskSetCompleted); ActivateModsListViewItem lviActivation = new ActivateModsListViewItem(p_tskTask, this); UpdateBottomBarFeedback(lviActivation, new EventArgs()); lvwActiveTasks.Items.Add(lviActivation); lviActivation.EnsureVisible(); if ((ViewModel.RunningTask == null) || (ViewModel.RunningTask.IsCompleted)) { ViewModel.RunningTask = p_tskTask; if (ViewModel.RunningTask.GetType() == typeof(ModInstaller)) ((ModInstaller)ViewModel.RunningTask).Install(); else if (ViewModel.RunningTask.GetType() == typeof(ModUninstaller)) ((ModUninstaller)ViewModel.RunningTask).Install(); else if (ViewModel.RunningTask.GetType() == typeof(ModUpgrader)) ((ModUpgrader)ViewModel.RunningTask).Install(); } else { QueuedTasks.Add(p_tskTask); } }
public void CallUpdateBottomBarFeedback(ActivateModsListViewItem p_ActivateModList) { UpdateBottomBarFeedback(p_ActivateModList, new EventArgs()); }