/// <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> /// 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> /// 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> /// 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); } }