Exemple #1
0
        public string showSaveDialog(BrowserWindow browserWindow, SaveDialogOptions options,
                                     Action <string, string> callback)
        {
            if (callback == null)
            {
                return(showSaveDialog(browserWindow, options));
            }
            string       eventName = "_showSaveDialog";
            CallbackItem item      = null;

            item = API.CreateCallbackItem(eventName, (object[] args) => {
                API.RemoveCallbackItem(eventName, item);
                string filename = Convert.ToString(args[0]);
                string bookmark = Convert.ToString(args[1]);
                callback?.Invoke(filename, bookmark);
            });
            if (browserWindow == null)
            {
                API.Apply("showSaveDialog", options, item);
            }
            else
            {
                API.Apply("showSaveDialog", browserWindow, options, item);
            }
            return(null);
        }
Exemple #2
0
 public string showSaveDialog(BrowserWindow browserWindow, SaveDialogOptions options)
 {
     if (browserWindow == null)
     {
         return(API.Apply <string>("showSaveDialog", options));
     }
     else
     {
         return(API.Apply <string>("showSaveDialog", browserWindow, options));
     }
 }
Exemple #3
0
 public string showSaveDialog(SaveDialogOptions options, Action <string, string> callback)
 {
     return(showSaveDialog(null, options, callback));
 }
Exemple #4
0
 /// <summary>
 /// Returns String, the path of the file chosen by the user,
 /// if a callback is provided it returns undefined.
 /// </summary>
 /// <param name="options"></param>
 /// <returns></returns>
 public string showSaveDialog(SaveDialogOptions options)
 {
     return(showSaveDialog(null, options));
 }