/// <summary> /// Load all kerbals from KML Tree. /// </summary> /// <param name="master">The GuiTreeManager that manages the loaded tree</param> public void Load(GuiTreeManager master) { Kerbals.Clear(); KerbalsList.Items.Clear(); KerbalsDetails.Items.Clear(); List <KmlKerbal> list = master.GetFlatList <KmlKerbal>(); foreach (KmlKerbal kerbal in list) { if (kerbal.Origin == KmlKerbal.KerbalOrigin.Roster) { Kerbals.Add(kerbal); } } // Sort the list Kerbals = Kerbals.OrderBy(x => x.Name).ToList(); foreach (KmlKerbal kerbal in Kerbals) { GuiKerbalsNode node = new GuiKerbalsNode(kerbal); node.MouseDoubleClick += KerbalsNode_MouseDoubleClick; KerbalsList.Items.Add(node); } // Apply current filter and count visible items UpdateVisibility(); }
/// <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(); }