Exemplo n.º 1
0
 public static string Save(FileDialogFilters filters = null)
 {
     if (Platform.RunningOS == OS.Windows)
     {
         if (Win32.Win32SaveDialog(Win32.ConvertFilters(filters), null, out string result))
         {
             return(result);
         }
         else
         {
             return(null);
         }
     }
     else if (Platform.RunningOS == OS.Linux)
     {
         if (kdialog)
         {
             return(KDialogSave(filters));
         }
         else if (parentWindow != IntPtr.Zero)
         {
             return(Gtk2.GtkSave(parentWindow, filters));
         }
         else
         {
             return(Gtk3.GtkSave(filters));
         }
     }
     else
     {
         //Mac
         throw new NotImplementedException();
     }
 }
Exemplo n.º 2
0
 public static string Save(FileDialogFilters filters = null)
 {
     if (Platform.RunningOS == OS.Windows)
     {
         string result = null;
         using (var sfd = NewObj("System.Windows.Forms.SaveFileDialog"))
         {
             if (parentForm != null)
             {
                 sfd.Parent = parentForm;
             }
             if (filters != null)
             {
                 sfd.Filter = SwfFilter(filters);
             }
             if (sfd.ShowDialog() == SwfOk())
             {
                 result = sfd.FileName;
             }
         }
         WinformsDoEvents();
         return(result);
     }
     else if (Platform.RunningOS == OS.Linux)
     {
         if (kdialog)
         {
             return(KDialogSave());
         }
         else if (parentWindow != IntPtr.Zero)
         {
             return(Gtk2.GtkSave(parentWindow, filters));
         }
         else
         {
             return(Gtk3.GtkSave(filters));
         }
     }
     else
     {
         //Mac
         throw new NotImplementedException();
     }
 }