Пример #1
0
 public Main1(Main2 w1)
 {
     wnd1 = w1;
     InitializeComponent();
     try
     {
         using (FileStream fs = new FileStream(@"../../input.txt", FileMode.OpenOrCreate, FileAccess.Read))
         {
             string[]     data;
             CustomCars   crs;
             StreamReader sr = new StreamReader(fs, Encoding.Default);
             while (!sr.EndOfStream)
             {
                 data = sr.ReadLine().Split(' ');
                 crs  = new CustomCars(data[0], data[1], int.Parse(data[2]), data[3], int.Parse(data[4]));
                 cars.Add(crs);
             }
             sr.Close();
             fs.Close();
         }
     }catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     RefreshCarsTXT();
     foreach (CustomCars crs in cars)
     {
         carList.Items.Add(crs);
     }
 }
Пример #2
0
 public WebBr(Main2 w5)
 {
     wnd5 = w5;
     InitializeComponent();
 }
Пример #3
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            Main2 wnd2 = new Main2(this);

            wnd2.Show();
        }