public void FileSaveAs() { SaveFileDialog sfd = new SaveFileDialog(); DirectoryInfo dir = new DirectoryInfo(Global.Properties.GetValue <string>("LastDir", Global.Setup.InstrumentsDirectory.FullName)); if (!dir.Exists) { dir = new DirectoryInfo(Global.Setup.InstrumentsDirectory.FullName); } sfd.InitialDirectory = dir.FullName; sfd.Filter = "Visual C# (*.cs)|*.cs|Visual Basic (*.vb)|*.vb|All files (*.*)|*.*"; if (sfd.ShowDialog() != DialogResult.OK) { return; } ITabbedFileDocument fileDoc = Global.DockManager.ActiveDocument as ITabbedFileDocument; if (fileDoc == null) { return; } fileDoc.SaveAsContent(new FileInfo(sfd.FileName)); this._recentFilesManager.Add(fileDoc.ContentFile); Global.Properties.SetValue <string>("LastDir", fileDoc.ContentFile.Directory.FullName); }
public void UpdateIDE() { ITabbedFileDocument fileDoc = Global.DockManager.ActiveDocument as ITabbedFileDocument; _btnFileSave.Enabled = _menuItemFileSave.Enabled = fileDoc != null && !fileDoc.IsContentSaved; _menuItemFileSaveAs.Enabled = fileDoc != null; _menuItemFileClose.Enabled = fileDoc != null; }
public void FileSave() { ITabbedFileDocument fileDoc = Global.DockManager.ActiveDocument as ITabbedFileDocument; if (fileDoc == null) { return; } fileDoc.SaveContent(); this._recentFilesManager.Add(fileDoc.ContentFile); }
public void FileSaveAll() { foreach (TabbedDocument document in Global.DockManager.GetDocumentArray()) { ITabbedFileDocument fileDoc = document as ITabbedFileDocument; if (fileDoc == null) { continue; } fileDoc.SaveContent(); } }
private void DockManager_ContentRemoved(object sender, WeifenLuo.WinFormsUI.Docking.DockContentEventArgs e) { ITabbedFileDocument fileDoc = e.Content as ITabbedFileDocument; if (fileDoc == null) { return; } this._recentFilesManager.Update(); fileDoc.ContentChanged -= new EventHandler(fileDoc_ContentChanged); fileDoc.ContentSaved -= new EventHandler(fileDoc_ContentSaved); }