Exemple #1
0
        private void SaveDocumentAs()
        {
            if (this.ActiveMdiChild == null)
            {
                return;
            }
            frmDocument doc = this.ActiveMdiChild as frmDocument;

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

            saveFileDialog1.ShowDialog();
            if (saveFileDialog1.FileName == "")
            {
                return;
            }
            doc.FileName = saveFileDialog1.FileName;
            doc.SaveFile();
        }
Exemple #2
0
 internal void SaveDocument(frmDocument doc)
 {
     if (doc.FileName == "")
     {
         if (saveFileDialog1.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         if (saveFileDialog1.FileName == "")
         {
             return;
         }
         doc.FileName = saveFileDialog1.FileName;
     }
     if (doc.FileName != "")
     {
         doc.SaveFile();
     }
 }