/// <summary> /// Context > Show in Skill Browser /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void showInSkillBrowserMenu_Click(object sender, EventArgs e) { Skill skill = ((SkillLevel)tvSkillList.SelectedNode?.Tag)?.Skill; // Open the skill browser PlanWindow.ShowPlanWindow(null, m_plan).ShowSkillInBrowser(skill); }
/// <summary> /// Context menu > Show "skill" in browser | Show "certificate class" certificates. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void showInBrowserMenu_Click(object sender, EventArgs e) { // Retrieve the owner window PlanWindow npw = WindowsFactory <PlanWindow> .GetByTag(m_plan); if (npw == null || npw.IsDisposed) { return; } // Return when nothing is selected if (this.treeView.SelectedNode == null) { return; } Certificate cert = this.treeView.SelectedNode.Tag as Certificate; // When a certificate is selected, we select its class in the left tree if (cert != null) { npw.ShowCertInBrowser(cert); } // When a skill is selected, we select it in the skill browser else { SkillLevel prereq = (SkillLevel)this.treeView.SelectedNode.Tag; npw.ShowSkillInBrowser(prereq.Skill); } }
/// <summary> /// Treeview's context menu > Plan "(selection)". /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tsmAddToPlan_Click(object sender, EventArgs e) { CertificateLevel cert = treeView.SelectedNode.Tag as CertificateLevel; IPlanOperation operation; if (cert != null) { operation = m_plan.TryPlanTo(cert); } else { SkillLevel prereq = (SkillLevel)treeView.SelectedNode.Tag; operation = m_plan.TryPlanTo(prereq.Skill, prereq.Level); } if (operation == null) { return; } PlanWindow planWindow = ParentForm as PlanWindow; if (planWindow == null) { return; } PlanHelper.SelectPerform(new PlanToOperationWindow(operation), planWindow, operation); }
/// <summary> /// Event handler for treenode double click event. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tvCertList_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { // Get selected node TreeNode selectedNode = e.Node as TreeNode; // Make sure we have a skill to use if (selectedNode.Tag == null) { return; } if (selectedNode.Tag is Certificate) { PlanWindow pw = WindowsFactory <PlanWindow> .GetByTag(m_plan); Certificate cert = ((Certificate)selectedNode.Tag); pw.ShowCertInBrowser(cert); } else { // Open skill browser tab for this skill PlanWindow pw = WindowsFactory <PlanWindow> .GetByTag(m_plan); Skill skill = ((SkillLevel)selectedNode.Tag).Skill; pw.ShowSkillInBrowser(skill); } }
/// <summary> /// When the user double-click an item or uses the "Show /// in item browser" context menu item, we open the items /// browser. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tvLoadout_DoubleClick(object sender, EventArgs e) { // user double clicked an area that isn't a node Item item = tvLoadout.SelectedNode?.Tag as Item; PlanWindow.ShowPlanWindow(m_character, m_plan).ShowItemInBrowser(item); }
/// <summary> /// Event handler for treenode double click event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tvSkillList_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { Skill skill = ((SkillLevel)e.Node.Tag)?.Skill; // Open skill browser tab for this skill PlanWindow.ShowPlanWindow(null, m_plan).ShowSkillInBrowser(skill); }
/// <summary> /// Handler for the ship-links generated for the recommendations. /// </summary> private void recommendations_MenuItem(object sender, EventArgs e) { Item ship = ((Control)sender)?.Tag as Item; // Open the ship browser PlanWindow.ShowPlanWindow(certSelectControl.Character, m_plan).ShowShipInBrowser(ship); }
/// <summary> /// Context menu > Show "skill" in browser | Show "certificate class" certificates. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void showInBrowserMenu_Click(object sender, EventArgs e) { // Return when nothing is selected if (treeView.SelectedNode == null) { return; } var certLevel = treeView.SelectedNode.Tag as CertificateLevel; // When a certificate is selected, we select its class in the left tree if (certLevel != null) { // Open the certificate browser PlanWindow.ShowPlanWindow(m_character, m_plan).ShowCertificateInBrowser(certLevel); } // When a skill is selected, we select it in the skill browser else { Skill skill = ((SkillLevel)treeView.SelectedNode?.Tag)?.Skill; // Open the skill browser PlanWindow.ShowPlanWindow(m_character, m_plan).ShowSkillInBrowser(skill); } }
/// <summary> /// Context menu > Show "skill" in browser | Show "certificate class" certificates. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void showInBrowserMenu_Click(object sender, EventArgs e) { Skill skill = ((SkillLevel)treeView.SelectedNode?.Tag)?.Skill; // Open the skill browser PlanWindow.ShowPlanWindow(m_character, m_plan).ShowSkillInBrowser(skill); }
/// <summary> /// Constructor for use in code /// </summary> /// <param name="skill">The skill we want to analyze</param> /// <param name="planWindow">The plan window</param> public SkillExplorerWindow(Skill skill, PlanWindow planWindow) : this() { m_planWindow = planWindow; Skill = skill; EveClient.PlanChanged += new EventHandler <PlanChangedEventArgs>(EveClient_PlanChanged); EveClient.CharacterChanged += new EventHandler <CharacterChangedEventArgs>(EveClient_CharacterChanged); }
/// <summary> /// On activation, we import the up-to-date plan column settings. /// </summary> /// <param name="e"></param> protected override void OnActivated(EventArgs e) { base.OnActivated(e); if (s_lastActivated != this) { s_lastActivated = this; planEditor.ImportColumnSettings(Settings.UI.PlanWindow.Columns); } }
/// <summary> /// Constructor for use in code /// </summary> /// <param name="skill">The skill we want to analyze</param> /// <param name="planWindow">The plan window</param> public SkillExplorerWindow(Skill skill, PlanWindow planWindow) : this() { m_planWindow = planWindow; Skill = skill; EveClient.PlanChanged += new EventHandler<PlanChangedEventArgs>(EveClient_PlanChanged); EveClient.CharacterChanged += new EventHandler<CharacterChangedEventArgs>(EveClient_CharacterChanged); }
/// <summary> /// Context menu > Show "skill" in browser | Show "certificate class" certificates. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void showInBrowserMenu_Click(object sender, EventArgs e) { var skillTag = treeView.SelectedNode?.Tag as SkillLevel; if (skillTag != null) { // Open the skill browser PlanWindow.ShowPlanWindow(m_character, m_plan).ShowSkillInBrowser(skillTag. Skill); } }
/// <summary> /// Context menu > Show In Skill Explorer /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void showInSkillExplorerMenu_Click(object sender, EventArgs e) { // Retrieve the owner window PlanWindow npw = WindowsFactory <PlanWindow> .GetByTag(m_plan); if (npw == null || npw.IsDisposed) { return; } // Open the skill explorer npw.ShowSkillInExplorer(SelectedSkill); }
/// <summary> /// Show the item in its appropriate browser. /// </summary> /// <param name="item"></param> private void ShowInBrowser(Item item) { PlanWindow pw = WindowsFactory <PlanWindow> .GetByTag(m_plan); if (item is Ship) { pw.ShowShipInBrowser(item); } else { pw.ShowItemInBrowser(item); } }
/// <summary> /// Browses the form that opened this instance of EFTLoadout to /// the item that was double clicked in the TreeView. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">Arguments of the event.</param> private void tvLoadout_DoubleClick(object sender, EventArgs e) { if (ResultsTreeView.SelectedNode != null) { Item item = ResultsTreeView.SelectedNode.Tag as Item; if (item != null) { PlanWindow opener = WindowsFactory <PlanWindow> .GetByTag(m_plan); opener.ShowItemInBrowser(item); } } }
/// <summary> /// Show the item in its appropriate browser. /// </summary> /// <param name="item"></param> private void ShowInBrowser(Item item) { PlanWindow planWindow = ParentForm as PlanWindow; if (item is Ship) { planWindow?.ShowShipInBrowser(item); } else { planWindow?.ShowItemInBrowser(item); } }
/// <summary> /// Context > Show in Skill Browser /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void showInSkillBrowserMenu_Click(object sender, EventArgs e) { // Retrieve the owner window PlanWindow npw = WindowsFactory <PlanWindow> .GetByTag(m_plan); if (npw == null || npw.IsDisposed) { return; } // Open the skill explorer var skillLevel = (SkillLevel)tvSkillList.SelectedNode.Tag; npw.ShowSkillInBrowser(skillLevel.Skill); }
/// <summary> /// The button "open" is the same than "merge". When the button is in "open" state, we close the window and returns OK as a result. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOpen_Click(object sender, EventArgs e) { // Are we performing a merge ? if (lbPlanList.SelectedItems.Count > 1) { MergePlans(); return; } // Or are we just opening a plan ? Plan plan = (Plan)lbPlanList.SelectedItems[0].Tag; PlanWindow.ShowPlanWindow(plan: plan); Close(); }
/// <summary> /// Context menu > Show "skill" in explorer. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void showInExplorerMenu_Click(object sender, EventArgs e) { // Retrieve the owner window PlanWindow npw = WindowsFactory <PlanWindow> .GetByTag(m_plan); if (npw == null || npw.IsDisposed) { return; } // Open the skill explorer SkillLevel prereq = (SkillLevel)this.treeView.SelectedNode.Tag; npw.ShowSkillInExplorer(prereq.Skill); }
/// <summary> /// Handler for the ship-links generated for the recommendations /// </summary> void recommendations_MenuItem(object sender, EventArgs e) { Control tsi = sender as Control; if (tsi == null) { return; } Item ship = tsi.Tag as Item; PlanWindow window = WindowsFactory <PlanWindow> .GetByTag(m_plan); if (ship != null && window != null && !window.IsDisposed) { window.ShowShipInBrowser(ship); } }
/// <summary> /// On activation, we import the up-to-date plan column settings. /// </summary> /// <param name="e"></param> protected override void OnActivated(EventArgs e) { base.OnActivated(e); if (s_lastActivated == this) { return; } s_lastActivated = this; if (m_plan != null) { planEditor.ImportColumnSettings(Settings.UI.PlanWindow.Columns); } }
/// <summary> /// On closing, we unsubscribe the global events to help the GC. /// </summary> /// <param name="e"></param> protected override void OnFormClosing(FormClosingEventArgs e) { base.OnFormClosing(e); // Unsubscribe global events EveMonClient.PlanNameChanged -= EveMonClient_PlanNameChanged; EveMonClient.SettingsChanged -= EveMonClient_SettingsChanged; EveMonClient.ItemPricesUpdated -= EveMonClient_ItemPricesUpdated; // Save settings if this one is the last activated and up-to-date if (s_lastActivated == this) { if (tabControl.TabPages.Contains(tpPlanEditor)) { Settings.UI.PlanWindow.Columns.Clear(); Settings.UI.PlanWindow.Columns.AddRange(planEditor.ExportColumnSettings()); } s_lastActivated = null; } Settings.Save(); // We're closing down if (e.CloseReason != CloseReason.ApplicationExitCall && // and Application.Exit() was not called e.CloseReason != CloseReason.TaskManagerClosing && // and the user isn't trying to shut the program down for some reason e.CloseReason != CloseReason.WindowsShutDown) // and Windows is not shutting down { // Tell the loadout importation window we're closing down WindowsFactory.GetAndCloseByTag <LoadoutImportationWindow, Character>(m_character); // Tell the ship loadout window we're closing down WindowsFactory.GetAndCloseByTag <ShipLoadoutSelectWindow, Character>(m_character); // Tell the skill explorer we're closing down WindowsFactory.GetAndCloseByTag <SkillExplorerWindow, Character>(m_character); // Tell the attributes optimization window we're closing down WindowsFactory.GetAndCloseByTag <AttributesOptimizerOptionsWindow, PlanEditorControl>(planEditor); WindowsFactory.GetAndCloseByTag <AttributesOptimizerWindow, PlanEditorControl>(planEditor); // Tell the implant window we're closing down WindowsFactory.GetAndCloseByTag <ImplantCalculatorWindow, PlanEditorControl>(planEditor); } }
/// <summary> /// Event handler for treenode double click event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tvSkillList_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { // Get selected node TreeNode thisNode = e.Node as TreeNode; // Make sure we have a skill to use if (thisNode.Tag == null) { return; } // Open skill browser tab for this skill PlanWindow pw = WindowsFactory <PlanWindow> .GetByTag(m_plan); Skill skill = ((SkillLevel)thisNode.Tag).Skill; pw.ShowSkillInBrowser(skill); }
/// <summary> /// Context menu > Plan to N / Remove. /// Toolbar > Plan to... > Level N / Remove. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void planToMenu_Click(object sender, EventArgs e) { IPlanOperation operation = ((ToolStripMenuItem)sender).Tag as IPlanOperation; if (operation == null) { return; } PlanWindow planWindow = ParentForm as PlanWindow; if (planWindow == null) { return; } PlanHelper.SelectPerform(new PlanToOperationWindow(operation), planWindow, operation); }
/// <summary> /// On closing, we unsubscribe the global events to help the GC. /// </summary> /// <param name="e"></param> protected override void OnFormClosing(FormClosingEventArgs e) { // Save settings if this one is the last activated and up-to-date if (s_lastActivated == this) { Settings.UI.PlanWindow.Columns = planEditor.ExportColumnSettings().ToArray(); s_lastActivated = null; } // Unsubscribe global events EveClient.PlanChanged -= new EventHandler <PlanChangedEventArgs>(EveClient_PlanChanged); Settings.Save(); // Tell the skill explorer we're closing down if (!(e.CloseReason == CloseReason.ApplicationExitCall) && // and Application.Exit() was not called !(e.CloseReason == CloseReason.TaskManagerClosing) && // and the user isn't trying to shut the program down for some reason !(e.CloseReason == CloseReason.WindowsShutDown)) // and Windows is not shutting down { WindowsFactory <SkillExplorerWindow> .CloseByTag(this); } // Tell the attributes optimization window we're closing if (m_attributesOptimizerWindow != null) { m_attributesOptimizerWindow.Close(); m_attributesOptimizerWindow = null; } // Tell the implant window we're closing if (m_implantCalcWindow != null) { m_implantCalcWindow.Close(); m_implantCalcWindow = null; } // Tells the loadout browser we're closing if (m_loadoutForm != null) { m_loadoutForm.Close(); m_loadoutForm = null; } base.OnFormClosing(e); }
/// <summary> /// Occurs when double clicking on a list view item. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void propertiesList_DoubleClick(object sender, EventArgs e) { // Is it a skill? Skill skill = PropertiesList.FocusedItem?.Tag as Skill; if (skill != null) { PlanWindow.ShowPlanWindow(SelectControl.Character, Plan)?.ShowSkillInBrowser(skill); return; } // Is it an item? Item item = PropertiesList.FocusedItem?.Tag as Item; if (item != null) { PlanWindow.ShowPlanWindow(SelectControl.Character, Plan)?.ShowItemInBrowser(item); } }
/// <summary> /// When the user clicks the "plan" button, we add the prerqs to the plan and refresh the display. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPlan_Click(object sender, EventArgs e) { IPlanOperation operation = m_plan.TryAddSet(m_prerequisites, m_selectedLoadout.Name); if (operation == null) { return; } PlanWindow planWindow = PlanWindow.ShowPlanWindow(plan: operation.Plan); if (planWindow == null) { return; } PlanHelper.Perform(new PlanToOperationWindow(operation), planWindow); UpdatePlanningControls(); }
/// <summary> /// Adds the required skills to the Plan specified by the Plan property. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPlan_Click(object sender, EventArgs e) { IPlanOperation operation = m_plan.TryAddSet(m_skillsToAdd, m_loadoutInfo.Loadouts.First().Name); if (operation == null) { return; } PlanWindow planWindow = PlanWindow.ShowPlanWindow(plan: operation.Plan); if (planWindow == null) { return; } PlanHelper.Perform(new PlanToOperationWindow(operation), planWindow); planWindow.ShowPlanEditor(); UpdatePlanStatus(); }
/// <summary> /// Updates the owned skill book controls. /// </summary> private void UpdateOwnedSkillBookControls() { // Set button check state according to skills 'owned' property; // this will also trigger a check through the character's assets ownsBookToolStripButton.Checked = m_selectedSkill.IsOwned | (m_selectedSkill.HasBookInAssets && !m_selectedSkill.IsKnown); skillSelectControl.UpdateContent(); // Update also the skill selector of the Plan Editor PlanWindow planWindow = ParentForm as PlanWindow; planWindow?.UpdatePlanEditorSkillSelection(); // Update the Owned Skill books window if open OwnedSkillBooksWindow ownedSkillBooksWindow = WindowsFactory.GetByTag <OwnedSkillBooksWindow, Character>((Character)m_plan.Character); ownedSkillBooksWindow?.UpdateList(); }
/// <summary> /// When the user double-click an item or uses the "Show /// in item browser" context menu item, we open the items /// browser. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tvLoadout_DoubleClick(object sender, EventArgs e) { // user double clicked an area that isn't a node if (tvLoadout.SelectedNode == null) { return; } Item item = tvLoadout.SelectedNode.Tag as Item; // if the loadout node isn't tagged or we couldn't cast it // to an Item return if (item == null) { return; } PlanWindow window = WindowsFactory <PlanWindow> .ShowByTag(m_plan); window.ShowItemInBrowser(item); }
/// <summary> /// On activation, we import the up-to-date plan column settings. /// </summary> /// <param name="e"></param> protected override void OnActivated(EventArgs e) { base.OnActivated(e); if (s_lastActivated == this) return; s_lastActivated = this; if (m_plan != null) planEditor.ImportColumnSettings(Settings.UI.PlanWindow.Columns); }
/// <summary> /// On closing, we unsubscribe the global events to help the GC. /// </summary> /// <param name="e"></param> protected override void OnFormClosing(FormClosingEventArgs e) { base.OnFormClosing(e); // Unsubscribe global events EveMonClient.PlanNameChanged -= EveMonClient_PlanNameChanged; EveMonClient.SettingsChanged -= EveMonClient_SettingsChanged; // Save settings if this one is the last activated and up-to-date if (s_lastActivated == this) { if (tabControl.TabPages.Contains(tpPlanEditor)) { Settings.UI.PlanWindow.Columns.Clear(); Settings.UI.PlanWindow.Columns.AddRange(planEditor.ExportColumnSettings()); } s_lastActivated = null; } Settings.Save(); // We're closing down if (e.CloseReason != CloseReason.ApplicationExitCall && // and Application.Exit() was not called e.CloseReason != CloseReason.TaskManagerClosing && // and the user isn't trying to shut the program down for some reason e.CloseReason != CloseReason.WindowsShutDown) // and Windows is not shutting down { // Tell the loadout importation window we're closing down WindowsFactory.GetAndCloseByTag<LoadoutImportationWindow, Character>(m_character); // Tell the ship loadout window we're closing down WindowsFactory.GetAndCloseByTag<ShipLoadoutSelectWindow, Character>(m_character); // Tell the skill explorer we're closing down WindowsFactory.GetAndCloseByTag<SkillExplorerWindow, Character>(m_character); // Tell the attributes optimization window we're closing down WindowsFactory.GetAndCloseByTag<AttributesOptimizerOptionsWindow, PlanEditorControl>(planEditor); WindowsFactory.GetAndCloseByTag<AttributesOptimizerWindow, PlanEditorControl>(planEditor); // Tell the implant window we're closing down WindowsFactory.GetAndCloseByTag<ImplantCalculatorWindow, PlanEditorControl>(planEditor); } }
/// <summary> /// On closing, we unsubscribe the global events to help the GC. /// </summary> /// <param name="e"></param> protected override void OnFormClosing(FormClosingEventArgs e) { // Save settings if this one is the last activated and up-to-date if (s_lastActivated == this) { Settings.UI.PlanWindow.Columns = planEditor.ExportColumnSettings().ToArray(); s_lastActivated = null; } // Unsubscribe global events EveClient.PlanChanged -= EveClient_PlanChanged; EveClient.SettingsChanged -= EveClient_SettingsChanged; Settings.Save(); // We're closing down if (!(e.CloseReason == CloseReason.ApplicationExitCall) && // and Application.Exit() was not called !(e.CloseReason == CloseReason.TaskManagerClosing) && // and the user isn't trying to shut the program down for some reason !(e.CloseReason == CloseReason.WindowsShutDown)) // and Windows is not shutting down { // Tell the skill explorer we're closing down WindowsFactory<SkillExplorerWindow>.CloseByTag(this); // Tell the attributes optimization window we're closing down if (m_attributesOptimizerWindow != null) { m_attributesOptimizerWindow.Close(); } // Tell the implant window we're closing down if (m_implantCalcWindow != null) { m_implantCalcWindow.Close(); } } base.OnFormClosing(e); }