コード例 #1
0
ファイル: GuiVesselsPartGraph.cs プロジェクト: trumb/KML
 /// <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);
     }
 }
コード例 #2
0
ファイル: GuiVesselsManager.cs プロジェクト: trumb/KML
        /// <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();
        }
コード例 #3
0
 private void partGraphTimer_Tick(object sender, EventArgs e)
 {
     if ((VesselsList.SelectedItem as GuiVesselsNode) == PartGraphNode)
     {
         return;
     }
     PartGraphNode = (VesselsList.SelectedItem as GuiVesselsNode);
     PartGraph.DrawPartStructure(PartGraphNode);
 }
コード例 #4
0
 private void VesselsList_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     VesselsDetails.Children.Clear();
     PartGraphNode = null;
     // PartGraph.DrawPartStructure(VesselsList.SelectedItem as GuiVesselsNode);
 }