/// <summary>
		/// A simple constructor that initializes the object with the given values.
		/// </summary>
		/// <param name="p_btsTask">The task whose status is to be displayed by this list
		/// view item.</param>
		public ActivateModsListViewItem(IBackgroundTaskSet p_btsTask, ActivateModsMonitorControl p_amcControl)
		{
			m_amcControl = p_amcControl;
			Task = p_btsTask;

			ListViewSubItem lsiSubItem = SubItems[0];
			lsiSubItem.Name = "ModName";

			if (p_btsTask.GetType() == typeof(ModUninstaller))
				lsiSubItem.Text = ((ModUninstaller)p_btsTask).ModName;
			else if (p_btsTask.GetType() == typeof(ModInstaller))
				lsiSubItem.Text = ((ModInstaller)p_btsTask).ModName;
			else if (p_btsTask.GetType() == typeof(ModUpgrader))
				lsiSubItem.Text = ((ModUpgrader)p_btsTask).ModName;
		
			lsiSubItem = SubItems.Add(new ListViewSubItem());
			lsiSubItem.Name = "Status";
			lsiSubItem.Text = "Queued";
			p_btsTask.IsQueued = true;

			lsiSubItem = SubItems.Add(new ListViewSubItem());
			lsiSubItem.Name = "Operation";
			lsiSubItem.Text = "";		

			lsiSubItem = SubItems.Add(new ListViewSubItem());
			lsiSubItem.Name = "Progress";

			lsiSubItem = SubItems.Add(new ListViewSubItem());
			lsiSubItem.Name = "?";

			m_booRemovable = true;
			p_btsTask.TaskStarted += new EventHandler<EventArgs<IBackgroundTask>>(TaskSet_TaskSetStarted);

			p_btsTask.TaskSetCompleted += new EventHandler<TaskSetCompletedEventArgs>(TaskSet_TaskSetCompleted);
		}
        /// <summary>
        /// A simple constructor that initializes the object with the given values.
        /// </summary>
        /// <param name="p_btsTask">The task whose status is to be displayed by this list
        /// view item.</param>
        public ActivateModsListViewItem(IBackgroundTaskSet p_btsTask, ActivateModsMonitorControl p_amcControl)
        {
            m_amcControl = p_amcControl;
            Task         = p_btsTask;

            ListViewSubItem lsiSubItem = SubItems[0];

            lsiSubItem.Name = "ModName";

            if (p_btsTask.GetType() == typeof(ModUninstaller))
            {
                lsiSubItem.Text = ((ModUninstaller)p_btsTask).ModName;
            }
            else if (p_btsTask.GetType() == typeof(ModInstaller))
            {
                lsiSubItem.Text = ((ModInstaller)p_btsTask).ModName;
            }
            else if (p_btsTask.GetType() == typeof(ModUpgrader))
            {
                lsiSubItem.Text = ((ModUpgrader)p_btsTask).ModName;
            }

            lsiSubItem         = SubItems.Add(new ListViewSubItem());
            lsiSubItem.Name    = "Status";
            lsiSubItem.Text    = "Queued";
            p_btsTask.IsQueued = true;

            lsiSubItem      = SubItems.Add(new ListViewSubItem());
            lsiSubItem.Name = "Operation";
            lsiSubItem.Text = "";

            lsiSubItem      = SubItems.Add(new ListViewSubItem());
            lsiSubItem.Name = "Progress";

            lsiSubItem      = SubItems.Add(new ListViewSubItem());
            lsiSubItem.Name = "?";

            m_booRemovable         = true;
            p_btsTask.TaskStarted += new EventHandler <EventArgs <IBackgroundTask> >(TaskSet_TaskSetStarted);

            p_btsTask.TaskSetCompleted += new EventHandler <TaskSetCompletedEventArgs>(TaskSet_TaskSetCompleted);
        }
Exemplo n.º 3
0
		/// <summary>
		/// A simple constructor that initializes the view with its dependencies.
		/// </summary>
		/// <param name="p_vmlViewModel">The view model that provides the data and operations for this view.</param>
		public MainForm(MainFormVM p_vmlViewModel)
		{

			InitializeComponent();

			this.FormClosing += new FormClosingEventHandler(this.CheckDownloadsOnClosing);

			this.ResizeEnd += MainForm_ResizeEnd;
			this.ResizeBegin += MainForm_ResizeBegin;
			this.Resize += MainForm_Resize;

			pmcPluginManager = new PluginManagerControl();
			mmgModManager = new ModManagerControl();
			dmcDownloadMonitor = new DownloadMonitorControl();
			dockPanel1.ActiveContentChanged += new EventHandler(dockPanel1_ActiveContentChanged);
			mmgModManager.SetTextBoxFocus += new EventHandler(mmgModManager_SetTextBoxFocus);
			mmgModManager.ResetSearchBox += new EventHandler(mmgModManager_ResetSearchBox);
			mmgModManager.UpdateModsCount += new EventHandler(mmgModManager_UpdateModsCount);
			dmcDownloadMonitor.SetTextBoxFocus += new EventHandler(dmcDownloadMonitor_SetTextBoxFocus);
			pmcPluginManager.UpdatePluginsCount += new EventHandler(pmcPluginManager_UpdatePluginsCount);
			amcActivateModsMonitor = new ActivateModsMonitorControl();
			amcActivateModsMonitor.EmptyQueue += new EventHandler(amcActivateModsMonitor_EmptyQueue);
			amcActivateModsMonitor.UpdateBottomBarFeedback += new EventHandler(amcActivateModsMonitor_UpdateBottomBarFeedback);
			p_vmlViewModel.ModManager.LoginTask.PropertyChanged += new PropertyChangedEventHandler(LoginTask_PropertyChanged);
			tsbTips.DropDownItemClicked += new ToolStripItemClickedEventHandler(tsbTips_DropDownItemClicked);

			ViewModel = p_vmlViewModel;

			try
			{
				InitializeDocuments();
			}
			catch
			{
				ResetUI();
			}

			p_vmlViewModel.EnvironmentInfo.Settings.WindowPositions.GetWindowPosition("MainForm", this);
			m_fwsLastWindowState = WindowState;
		}