コード例 #1
0
        private void OpenFile(object sender, EventArgs e)
        {
            DialogResult result = openFileDialog1.ShowDialog();

            if (result == DialogResult.OK)
            {
                currentFile  = openFileDialog1.FileName;
                wrestlerData = CharheadStream.GetWrestlerData(currentFile);

                if (wrestlerData == null)
                {
                    return;
                }

                RefreshWrestlerList();
            }

            openFileDialog1.Dispose();

            if (isDirty)
            {
                saveToolStripMenuItem.Enabled   = true;
                saveAsToolStripMenuItem.Enabled = true;
            }
        }
コード例 #2
0
        private void SaveAs(object sender, EventArgs e)
        {
            DialogResult result = saveFileDialog1.ShowDialog();

            if (result == DialogResult.OK)
            {
                CharheadStream.SaveWrestlerData(wrestlerData, saveFileDialog1.FileName);
            }

            currentFile  = saveFileDialog1.FileName;
            wrestlerData = CharheadStream.GetWrestlerData(currentFile);

            if (wrestlerData == null)
            {
                return;
            }

            isDirty = false;
            RefreshWrestlerList();

            saveFileDialog1.Dispose();
        }
コード例 #3
0
 private void Save(object sender, EventArgs e)
 {
     CharheadStream.SaveWrestlerData(wrestlerData, currentFile);
     isDirty = false;
     RefreshWrestlerList();
 }