Exemplo n.º 1
0
        public string SaveFile(string title, string initialDirectory, string defaultFileName, DialogFilterPair filter)
        {
            var builder = new CommonSaveDialogBuilder()
                          .Initialize(title, initialDirectory)
                          .SetDefaults(defaultFileName, filter.ExtensionsList)
                          .AddFilter(filter);

            string result = null;

            using (var dialog = builder.Build())
            {
                if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
                {
                    result = dialog.FileName;
                }
            }
            return(result);
        }
Exemplo n.º 2
0
        public string SaveFile(string title, string initialDirectory, string defaultFileName = null, DialogFilterPair filter = null, IntPtr?owner = null)
        {
            var builder = new CommonSaveDialogBuilder()
                          .Initialize(title, initialDirectory)
                          .SetDefaults(defaultFileName, filter.ExtensionsList)
                          .AddFilter(filter);

            return(Save(builder, owner));
        }
Exemplo n.º 3
0
 public List <string> OpenFiles(string title, string initialDirectory, DialogFilterPair filter)
 {
     return(OpenFiles(title, initialDirectory, new List <DialogFilterPair> {
         filter
     }));
 }