Пример #1
0
 private void SettingsForm_Load(object sender, EventArgs e)
 {
     main = this.Owner as TrainerForm;
     if (main != null)
         _currentSettings = main.CurrentSettings;
     saveTenLevel();
     numberOfLevelCB.SelectedIndex = 0;
     string[] rows = new string[]{row1,row2,row3,row4};
     rowsCB1.Items.AddRange(rows);
     rowsCB1.Enabled = true;
     rowsCB1.SelectedIndex = 2;
 }
Пример #2
0
 private void AddExercise_Load(object sender, EventArgs e)
 {
     main = this.Owner as WorkWithExercises;
     if (main != null)
     {
         currentSettings = main.CurrentSettings;
         getUsingSymbols();
     }
     
     // сделать вызов метода который по номеру уровня и по номеру зоны будет определять 
     // используемые символы
     // также этот метод должен выполняться при смене уровня и при изменении 
     // значения чекбоксов
      
 }
Пример #3
0
        private void deserealiseSettings()
        {
            FileInfo fi = null;
            try
            {
                fi = new FileInfo(settingPath);
                if (fi.Length != 0)
                {
                    FileStream stream = null;
                    _currentSettings = null;
                    try
                    {
                        stream = new FileStream(settingPath, FileMode.Open);
                        BinaryFormatter bf = new BinaryFormatter();
                        _currentSettings = (Settings)bf.Deserialize(stream);
                    }
                    catch (FileNotFoundException fnfe)
                    {

                    }
                    finally
                    {
                        if (stream != null)
                            stream.Close();
                    }

                }
                else
                {
                    _currentSettings = new Settings();
                }
            }
            catch (FileNotFoundException fnfe)
            {
                MessageBox.Show("Отсутствует файл с настройками.");
            }
        }
Пример #4
0
 public SettingsForm()
 {
     InitializeComponent();
     _currentSettings = new Settings();
     
 }
Пример #5
0
 private void WorkWithExercises_Load(object sender, EventArgs e)
 {
     main = this.Owner as TrainerForm;
     if (main != null)
         currentSettings = main.CurrentSettings;
 }