Esempio n. 1
0
        private void commandSaveAs_Executed(object sender, EventArgs e)
        {
            if (this.ActiveMdiChild == null)
            {
                return;
            }

            // Close menu popup if needed since File Dialogs can interfer with it
            if (sender is BaseItem)
            {
                BaseItem.CollapseAll(sender as BaseItem);
            }

            frmDocument doc = this.ActiveMdiChild as frmDocument;

            if (doc == null || !doc.DocumentChanged)
            {
                return;
            }
            if (doc.FileName == "")
            {
                SaveDocument(doc);
                return;
            }

            saveFileDialog1.ShowDialog();
            if (saveFileDialog1.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            if (saveFileDialog1.FileName == "")
            {
                return;
            }
            doc.FileName = saveFileDialog1.FileName;
            doc.SaveFile();
            doc.Text = Path.GetFileName(saveFileDialog1.FileName);
        }