示例#1
0
 /* 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);
     }
 }
示例#2
0
 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);
     }
 }