Beispiel #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (changes)
            {
                DialogResult dr = MessageBox.Show("WARNING: This will update the pub file you currently have open with any batch changes that have been made. Confirm that this behavior is desired.", "Confirm changes?", MessageBoxButtons.YesNo);
                if (dr == DialogResult.No)
                {
                    return;
                }

                bool   success;
                string msg = "";
                if (eif.Version == 0)
                {
                    MessageBox.Show("Saving using this tool will update the version of the EIF file.");

                    success = eif.Save(1, ref msg);
                }
                else
                {
                    success = eif.Save(eif.Version, ref msg);
                }

                MessageBox.Show(success ? "Changes saved." : "Error saving changes to the file:\n" + msg);
            }
            else
            {
                MessageBox.Show("Changes to the pub file were not detected. No changes have been processed.");
            }
        }
Beispiel #2
0
        /// <summary>
        /// Creates a new json data model, populates it with this item's data, and saves it to disk.
        /// </summary>
        public void Save()
        {
            ItemFile itemFile = new ItemFile();

            itemFile.PopulateFile(this);
            itemFile.Save();
        }