Пример #1
0
 private void saveToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (CurrentMob != null)
     {
         CurrentMob.SaveMobFile(CurrentMob.Filename);
         ShowCurrentSection();
     }
 }
Пример #2
0
        private void SaveMobFile()
        {
            MobFile mob = null;

            if (CurrentMob != null)
            {
                mob = CurrentMob;
            }
            else if (listView1.SelectedItems.Count > 0)
            {
                mob = MobFiles[listView1.SelectedIndices[0]];
            }
            if (mob == null)
            {
                return;
            }
            saveFileDialog1.InitialDirectory = mob.Filename.Substring(0, mob.Filename.LastIndexOf('\\'));
            saveFileDialog1.FileName         = mob.Filename.Substring(mob.Filename.LastIndexOf('\\') + 1);
            if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                mob.SaveMobFile(saveFileDialog1.FileName);
            }
            ShowCurrentSection();
        }