public Form1() { InitializeComponent(); try { FormSerialisor.Deserialise(this, Application.StartupPath + @"\serialise.xml"); } catch (Exception) { MessageBox.Show("Ошибка десериализации"); } }
private void button5_Click(object sender, EventArgs e) { using (OpenFileDialog dialog = new OpenFileDialog()) { if (dialog.ShowDialog(this) == DialogResult.OK) { FormSerialisor.Deserialise(this, dialog.FileName); } } }
/// <summary> /// フォーム初期化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FormOption_Load(object sender, EventArgs e) { string appPath = Common.getApplicationFolder(); if (!Directory.Exists(appPath)) { Directory.CreateDirectory(appPath); } FormSerialisor.Deserialise(this, appPath + Const.SETTING_XML); restoreLabelStr(); }
public void LoadWeekend(Form form) { OpenFileDialog findWeekend = new OpenFileDialog(); findWeekend.Filter = "XML files (*.XML)|*.XML"; if (findWeekend.ShowDialog() == DialogResult.OK) { try { if ((findWeekend.OpenFile()) != null) { FormSerialisor.Deserialise(form, findWeekend.FileName); } } catch (Exception ex) { MessageBox.Show("Error: Could not read file from disk, are you sure this is a FUTChamps Tracker Record? Original error: " + ex.Message); } } }
private void Form1_Load(object sender, EventArgs e) { FormSerialisor.Deserialise(this, ProgramFilesFolder + @"\vrpd.xml"); }
private void CowinNotifier_Load(object sender, EventArgs e) { FormSerialisor.Deserialise(this, Application.StartupPath + @"\serialise.xml"); }
private void fmMain_Load(object sender, EventArgs e) { FormSerialisor.Deserialise(this, Application.StartupPath + @"\serialise.xml"); txtResult.Text = ""; }