Пример #1
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         FormSerialisor.Serialise(this, Application.StartupPath + @"\serialise.xml");
     }
     catch (Exception) { MessageBox.Show("Ошибка сериализации"); }
 }
Пример #2
0
        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");
            }
        }
Пример #3
0
        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 + "");
            }
        }
Пример #4
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     outp.Text = "";
     button2_Click(sender, null);
     try
     {
         FormSerialisor.Serialise(this, ProgramFilesFolder + @"\vrpd.xml");
     }
     catch (Exception)
     {
     }
     finally
     {
     };
 }
Пример #5
0
        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();
        }
Пример #6
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     FormSerialisor.Serialise(this, Common.getApplicationFolder() + Const.SETTING_XML);
     this.Close();
 }
Пример #7
0
 private void CowinNotifier_FormClosing(object sender, FormClosingEventArgs e)
 {
     FormSerialisor.Serialise(this, Application.StartupPath + @"\serialise.xml");
 }