/* Private methods */ private void OpenFile(EventHandler <TextChangedEventArgs> textChanged) { using (var ofd = new OpenFileDialog { Title = @"Select a file to open" }) { ofd.Filter = FileFilters.GetFilters(); if (ofd.ShowDialog(_tabStrip.Parent) == DialogResult.Cancel) { return; } var info = new FileInfo(ofd.FileName); CreateTab(textChanged, info); } }
private string SaveFileAs(FaTabStripItem f) { using (var sfd = new SaveFileDialog { Title = string.Format(@"Select the filename to save {0} as...", f.Title) }) { sfd.Filter = FileFilters.GetFilters(); sfd.FileName = Path.GetFileNameWithoutExtension(f.Title); sfd.FilterIndex = FileFilters.GetExtensionIndex(string.Format("*{0}", Path.GetExtension(f.Title))); if (sfd.ShowDialog(_tabStrip.Parent) == DialogResult.Cancel) { return(string.Empty); } var fileName = sfd.FileName; f.Tag = fileName; System.Diagnostics.Debug.Print(fileName); return(fileName); } }