private void Form1_FormClosing(object sender, FormClosingEventArgs e) { try { FormSerialisor.Serialise(this, Application.StartupPath + @"\serialise.xml"); } catch (Exception) { MessageBox.Show("Ошибка сериализации"); } }
public void SaveGame(Form form) { SaveFileDialog saveWeekend = new SaveFileDialog(); saveWeekend.Filter = "XML files (*.XML)|*.XML"; if (saveWeekend.ShowDialog() == DialogResult.OK) { FormSerialisor.Serialise(form, saveWeekend.FileName + ".xml"); } }
private void button6_Click(object sender, EventArgs e) { SaveFileDialog dialog = new SaveFileDialog(); dialog.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*"; dialog.FilterIndex = 1; dialog.FileName = "sizing"; if (dialog.ShowDialog() == DialogResult.OK) { FormSerialisor.Serialise(this, dialog.FileName + ""); } }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { outp.Text = ""; button2_Click(sender, null); try { FormSerialisor.Serialise(this, ProgramFilesFolder + @"\vrpd.xml"); } catch (Exception) { } finally { }; }
void btnSaveProfile_Click(object sender, EventArgs e) { if (txtProfileName.Text.Length == 0) { return; } if (File.Exists(ProfilePath) && lstProfiles.Text != Path.GetFileNameWithoutExtension(ProfilePath)) { if (DialogResult.No == MessageBox.Show("Profile name already exists. Do you want to overwrite?", "Profile Name", MessageBoxButtons.YesNo, MessageBoxIcon.Question)) { return; } } FormSerialisor.Serialise(this, ProfilePath); Trace.TraceInformation("Saved"); LoadProfiles(); }
private void btnSave_Click(object sender, EventArgs e) { FormSerialisor.Serialise(this, Common.getApplicationFolder() + Const.SETTING_XML); this.Close(); }
private void CowinNotifier_FormClosing(object sender, FormClosingEventArgs e) { FormSerialisor.Serialise(this, Application.StartupPath + @"\serialise.xml"); }