示例#1
0
        private void SaveDocumentAs(DocumentWindow window)
        {
            string filename = BuildFileBrowser.BrowseForSave();

            if (filename != null)
            {
                NAntDocument document = _documents[window];

                try
                {
                    document.SaveAs(filename, window.Contents);
                    document.BuildFinished += _mainForm.SetStateStopped;

                    Settings.Default.SaveScriptInitialDir = document.Directory;
                    Settings.Default.Save();

                    RecentItems.Add(filename);
                    _mainForm.CreateRecentItemsMenu();
                    UpdateTitle();
                    UpdateDisplay();
                }
                catch (Exception ex)
                {
                    Errors.CouldNotSave(document.Name, ex.Message);
                }
            }
        }
示例#2
0
 internal void OpenDocument()
 {
     foreach (string filename in BuildFileBrowser.BrowseForLoad())
     {
         LoadDocument(filename);
     }
 }