private void SaveMenuItemClick(object sender, RoutedEventArgs e)
        {
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            saveFileDialog1.Filter           = "binary files (*.bin)|*.bin";
            saveFileDialog1.FilterIndex      = 1;
            saveFileDialog1.RestoreDirectory = true;
            saveFileDialog1.ShowDialog();

            string filename = saveFileDialog1.FileName;

            if (!String.IsNullOrEmpty(filename))
            {
                try
                {
                    BotSaver bs = new BotSaver();
                    bs.AddBots(bots.ToArray());

                    BinaryFormatter formatter = new BinaryFormatter();
                    using (FileStream fs = new FileStream(filename, FileMode.OpenOrCreate))
                    {
                        formatter.Serialize(fs, bs);
                        fs.Close();
                    }
                    Interaction.MsgBox("Сохранено в " + filename);
                }
                catch (Exception ex)
                {
                    Interaction.MsgBox("Ошибка: " + ex.Message);
                }
            }
        }
        private void LoadMenuItemClick(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.Filter           = "binary files (*.bin)|*.bin";
            openFileDialog1.FilterIndex      = 1;
            openFileDialog1.RestoreDirectory = true;
            openFileDialog1.ShowDialog();

            string filename = openFileDialog1.FileName;

            if (!String.IsNullOrEmpty(filename))
            {
                try
                {
                    BinaryFormatter formatter = new BinaryFormatter();
                    FileStream      fs        = new FileStream(filename, FileMode.OpenOrCreate);

                    BotSaver saver = (BotSaver)formatter.Deserialize(fs);
                    Bot[]    arr   = saver.GetBots();
                    bots.Clear();
                    foreach (var item in arr)
                    {
                        bots.Add(item);
                    }

                    fs.Close();

                    Interaction.MsgBox("Восстановлено из " + filename);
                }
                catch (Exception ex)
                {
                    Interaction.MsgBox("Произошла ошибка: " + ex.Message);
                }
                StepB.Opacity = 1;
                StepC.Opacity = 1;
                StepD.Opacity = 1;
                StepE.Opacity = 1;
                StepF.Opacity = 1;
            }
        }