Example #1
0
 private void tabControl1_DoubleClick(object sender, EventArgs e)
 {
     if (tabControl1.SelectedIndex == 0)
     {
         StationPage stationPage = new StationPage(new Station($"НПС {tabControl1.TabCount + 1}", null, null),
                                                   _pumpsFromStore);
         tabControl1.Controls.Add(stationPage);
     }
     else
     {
         tabControl1.Controls.Remove(tabControl1.SelectedTab);
     }
 }
Example #2
0
        public StationsForm(List <Station> stations)
        {
            InitializeComponent();
            XmlSerializer xmlSerializer = new XmlSerializer(typeof(XmlPump[]));

            using (StreamReader fsB = new StreamReader("BoostPumps.xml", Encoding.GetEncoding(1251)))
            {
                _pumpsFromStore = ((XmlPump[])xmlSerializer.Deserialize(fsB)).Select(p => p.GetRealPump()).ToList();
            }
            if (stations != null)
            {
                foreach (var st in stations)
                {
                    StationPage stationPage = new StationPage(st, _pumpsFromStore);
                    tabControl1.Controls.Add(stationPage);
                }
            }
            else
            {
                StationPage mainStation = new StationPage(new Station("НПС 1", null, null), _pumpsFromStore);
                tabControl1.Controls.Add(mainStation);
            }
        }
Example #3
0
        public void Execute(object parameter)
        {
            var f = new StationPage(_station);

            Application.Current.MainPage.Navigation.PushModalAsync(f);
        }