public void Base_upload(int index) { comments.Clear(); Spreadsheets spreadsheets = new Spreadsheets(); List <string> tbases = new List <string>(); for (int i = 0; i < bases.Count; i++) { string antierr; if (bases[i].Contains('<') == true) { antierr = bases[i].Insert(bases[i].IndexOf('<'), "меньше "); antierr = antierr.Replace('<', ' '); tbases.Add(antierr); } if (bases[i].Contains('>') == true) { antierr = bases[i].Insert(bases[i].IndexOf('>'), "больше "); antierr = antierr.Replace('>', ' '); tbases.Add(antierr); } else if (bases[i].Contains('<') == false && bases[i].Contains('>') == false) { tbases.Add(bases[i]); } } var sr = new StreamReader(spreadsheets.dir + $@"\Bases\" + $"{tbases[index]}.mcom"); while (sr.EndOfStream != true) { comments.Add(sr.ReadLine()); } sr.Close(); }
private async void Download_b_Click(object sender, RoutedEventArgs e) { Spreadsheets spreadsheets = new Spreadsheets(); download_b.IsEnabled = false; await Task.Run(() => { for (int id = 0; id < commenting.bases.Count; id++) { spreadsheets.Base_load(id); if (id == commenting.bases.Count - 1) { MessageBox.Show("Updating has been completed!", "Data", MessageBoxButton.OK); } } }); }
private void Auto_b_Click(object sender, RoutedEventArgs e) { bool auto; Spreadsheets spreadsheets = new Spreadsheets(); if (auto_b.Content.ToString() != "Отключить") { auto_b.Content = "Отключить"; auto = true; spreadsheets.automatisation(url_tb, Ccount_tb, dispersion_tb, sleep_tb, bases_lbox, unit_sl_s, unit_sl_d, auto, Reply_cb); } else if (auto_b.Content.ToString() == "Отключить") { auto_b.Content = "Автопилот"; auto = false; } }