private void btn_openFile_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog1 = new OpenFileDialog { InitialDirectory = @".", Title = "Browse Text Files", CheckFileExists = true, CheckPathExists = true, DefaultExt = "xml", Filter = "xml files (*.xml)|*.xml", FilterIndex = 2, RestoreDirectory = true, ReadOnlyChecked = true, ShowReadOnly = true }; if (openFileDialog1.ShowDialog() == DialogResult.OK) { label_currFile.Text = openFileDialog1.FileName; string fileName = openFileDialog1.FileName; XMLIO = new XMLSpeaker(fileName); setControls(true); search_optn.Items.AddRange(new object[] { "Поиск по курсу", "Поиск по группе", "Поиск по зач.книжке", "Поиск по фамилии", "Поиск по оценкам" }); UpdateRows(XMLIO.GetAllData()); } else { setControls(false); } }
public void GetSpeaker(XMLSpeaker IO) { XMLIO = IO; }