protected override bool OnFileDialog(CefBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, string[] acceptFilters, int selectedAcceptFilter, CefFileDialogCallback callback) { return(base.OnFileDialog(browser, mode, title, defaultFilePath, acceptFilters, selectedAcceptFilter, callback)); }
/// <summary> /// Called to run a file chooser dialog. /// </summary> /// <param name="browser">The browser object.</param> /// <param name="mode"> /// Represents the type of dialog to display. /// </param> /// <param name="title"> /// The title to be used for the dialog and may be empty to show the default title /// ('Open' or 'Save' depending on the mode). /// </param> /// <param name="defaultFilePath"> /// The path with optional directory and/or file name component that should be /// initially selected in the dialog. /// </param> /// <param name="acceptFilters"> /// Used to restrict the selectable file types and may any combination of /// <list type="bullet"> /// <item>valid lower-cased MIME types (e.g. 'text/*' or 'image/*');</item> /// <item>individual file extensions (e.g. '.txt' or '.png');</item> /// <item> /// combined description and file extension delimited using '|' and /// ';' (e.g. 'Image Types|.png;.gif;.jpg'). /// </item> /// </list> /// </param> /// <param name="selectedAcceptFilter"> /// The 0-based index of the filter that should be selected by default. /// </param> /// <param name="callback">A callback object.</param> /// <returns> /// To display a custom dialog return true and execute <paramref name="callback"/> /// either inline or at a later time. To display the default dialog return false. /// </returns> internal protected virtual bool OnFileDialog(CefBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, CefStringList acceptFilters, int selectedAcceptFilter, CefFileDialogCallback callback) { return(false); }
/// <inheritdoc /> internal protected override bool OnFileDialog(CefBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, CefStringList acceptFilters, int selectedAcceptFilter, CefFileDialogCallback callback) { callback.Cancel(); return(true); }
protected override bool OnFileDialog(CefBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, string[] acceptFilters, int selectedAcceptFilter, CefFileDialogCallback callback) { return(logic.OnFileDialog(ConvertDialogType(mode & CefFileDialogMode.TypeMask), acceptFilters, callback)); }
protected internal unsafe override bool OnFileDialog(CefBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, CefStringList acceptFilters, int selectedAcceptFilter, CefFileDialogCallback callback) { return(_implementation.OnFileDialog(browser, mode, title, defaultFilePath, acceptFilters, selectedAcceptFilter, callback)); }
protected override bool OnFileDialog(CefBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, string[] acceptFilters, int selectedAcceptFilter, CefFileDialogCallback callback) { if (mode == (CefFileDialogMode.Save | CefFileDialogMode.OverwritePromptFlag | CefFileDialogMode.HideReadOnlyFlag)) { var saveFileDialog = new SaveFileDialog(); saveFileDialog.FileName = defaultFilePath; //saveFileDialog.Filter = string.Join("Supported Files|*", acceptFilters); if (saveFileDialog.ShowDialog() == DialogResult.OK && saveFileDialog.FileName != "") { callback.Continue(selectedAcceptFilter, saveFileDialog.FileNames); } } else if (mode == (CefFileDialogMode.OpenFolder | CefFileDialogMode.OverwritePromptFlag | CefFileDialogMode.HideReadOnlyFlag)) { var dialog = new FolderBrowserDialog(); if (dialog.ShowDialog() == DialogResult.OK && dialog.SelectedPath != "") { callback.Continue(selectedAcceptFilter, new string[] { dialog.SelectedPath }); } } else if (mode == (CefFileDialogMode.OverwritePromptFlag | CefFileDialogMode.HideReadOnlyFlag)) { var dialog = new OpenFileDialog(); dialog.Multiselect = mode == CefFileDialogMode.OpenMultiple; if (dialog.ShowDialog() == DialogResult.OK && dialog.FileName != "") { callback.Continue(selectedAcceptFilter, dialog.FileNames); } } //else callback.Cancel(); return(base.OnFileDialog(browser, mode, title, defaultFilePath, acceptFilters, selectedAcceptFilter, callback)); }
protected override Boolean OnFileDialog(CefBrowser browser, CefFileDialogMode mode, String title, String defaultFileName, String[] acceptTypes, CefFileDialogCallback callback) { if (mode == CefFileDialogMode.Open || mode == CefFileDialogMode.OpenMultiple) { if (this.Client.HandleOpenFileDialog != null) { callback.Continue(this.Client.HandleOpenFileDialog(title, defaultFileName, acceptTypes)); return(true); } } else if (mode == CefFileDialogMode.Save) { if (this.Client.HandleSaveFileDialog != null) { callback.Continue(this.Client.HandleSaveFileDialog(title, defaultFileName, acceptTypes)); return(true); } } Log.Trace("DialogHandler.OnFileDialog( browser: {0}, mode: {1}, title: {2}, defaultFileName: {3}, acceptTypes: {4} )", browser.Identifier, Enum.GetName(typeof(CefFileDialogMode), mode), title, defaultFileName, String.Join(" ", acceptTypes)); return(false); //return base.OnFileDialog( browser, mode, title, defaultFileName, acceptTypes, callback ); }
protected override bool OnFileDialog(CefBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, string[] acceptFilters, int selectedAcceptFilter, CefFileDialogCallback callback) { if (OwnerWebView.DisableFileDialogs) { return(true); } return(false); }