private void LoadSpeakersFromFile(object sender, CancelEventArgs ar) { try { if (!premissionToConcatenateLists) { speakers = new ListOfSpeakers(); currentSpeakersId = 0; } LoadSpeakersFromDocFile(openFileDialog.FileName); settings.LastOpenedListLocation = openFileDialog.FileName; SilentSavingSettings(); } catch { MessageBox.Show("Не удалось открыть файл. Возможно, он поврежден.", Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public Form1() { InitializeComponent(); currentSpeakersId = 0; speakers = new ListOfSpeakers(); saveFileDialog.FileOk += new CancelEventHandler(SaveSpeakersToFile); openFileDialog.FileOk += new CancelEventHandler(LoadSpeakersFromFile); window2IsCreate = false; window1IsCreate = false; window1IsOpen = false; window2IsOpen = false; timerIsWorked = false; premissionToConcatenateLists = false; pause = false; canChangeSelect = true; isRepeatSignalPlayed = false; remainingTimersTime = 0; currentWorkedTimer = 0; lastSecond = DateTime.Now.Second; }