/// <summary> /// Doubleclicks on a ship/item leaf node will show the ship/item in the browser /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tvEntity_DoubleClick(object sender, EventArgs e) { if (m_planWindow == null) { return; } Item item = GetSelectedItem(); if (item == null) { return; } Item ship = item as Ship; Item blueprint = item as Blueprint; if (ship != null) { m_planWindow.ShowShipInBrowser(ship); } else if (blueprint != null) { m_planWindow.ShowBlueprintInBrowser(item); } else if (item != null) { m_planWindow.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> /// 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> /// Doubleclicks on a ship/item leaf node will show the ship/item in the browser /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tvEntity_DoubleClick(object sender, EventArgs e) { if (tvEntity.SelectedNode == null) { return; } Item ship = tvEntity.SelectedNode.Tag as Ship; Item item = tvEntity.SelectedNode.Tag as Item; if (ship != null) { m_planWindow.ShowShipInBrowser(ship); } else if (item != null) { m_planWindow.ShowItemInBrowser(item); } }
/// <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); }