/// <summary> /// Draws all parts of the KmlVessel that belongs to the given GuiVesselsNode. /// </summary> /// <param name="node">The GuiVesselsNode to read all parts from</param> public void DrawPartStructure(GuiVesselsNode node) { if (node != null) { DrawPartStructure(node.DataVessel); } }
/// <summary> /// Load all vessels from KML Tree. /// </summary> /// <param name="master">The GuiTreeManager that manages the loaded tree</param> public void Load(GuiTreeManager master) { Vessels.Clear(); VesselsList.Items.Clear(); VesselsDetails.Children.Clear(); List <KmlVessel> list = master.GetFlatList <KmlVessel>(); foreach (KmlVessel vessel in list) { if (vessel.Origin == KmlVessel.VesselOrigin.Flightstate) { Vessels.Add(vessel); } } // Sort the list Vessels = Vessels.OrderBy(x => x.Name).ToList(); foreach (KmlVessel vessel in Vessels) { GuiVesselsNode node = new GuiVesselsNode(vessel); node.MouseDoubleClick += VesselsNode_MouseDoubleClick; VesselsList.Items.Add(node); } // Apply current filter and count visible items UpdateVisibility(); }
private void partGraphTimer_Tick(object sender, EventArgs e) { if ((VesselsList.SelectedItem as GuiVesselsNode) == PartGraphNode) { return; } PartGraphNode = (VesselsList.SelectedItem as GuiVesselsNode); PartGraph.DrawPartStructure(PartGraphNode); }
private void VesselsList_SelectionChanged(object sender, SelectionChangedEventArgs e) { VesselsDetails.Children.Clear(); PartGraphNode = null; // PartGraph.DrawPartStructure(VesselsList.SelectedItem as GuiVesselsNode); }