mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 03:32:37 +00:00
Add CefFileDialogMode enum to IDialogHandler.OnFileDialog
This commit is contained in:
@@ -450,7 +450,7 @@ namespace CefSharp
|
||||
|
||||
List<System::String ^>^ resultString = nullptr;
|
||||
|
||||
result = handler->OnFileDialog(_browserControl, StringUtils::ToClr(title), StringUtils::ToClr(default_file_name), StringUtils::ToClr(accept_types), resultString);
|
||||
result = handler->OnFileDialog(_browserControl, (CefFileDialogMode)mode, StringUtils::ToClr(title), StringUtils::ToClr(default_file_name), StringUtils::ToClr(accept_types), resultString);
|
||||
callback->Continue(StringUtils::ToNative(resultString));
|
||||
|
||||
return result;
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace CefSharp.Example
|
||||
{
|
||||
public class TempFileDialogHandler : IDialogHandler
|
||||
{
|
||||
public bool OnFileDialog(IWebBrowser browser, string title, string defaultFileName, List<string> acceptTypes, out List<string> result)
|
||||
public bool OnFileDialog(IWebBrowser browser, CefFileDialogMode mode, string title, string defaultFileName, List<string> acceptTypes, out List<string> result)
|
||||
{
|
||||
result = new List<string> { Path.GetRandomFileName() };
|
||||
return true;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace CefSharp
|
||||
{
|
||||
public enum CefFileDialogMode
|
||||
{
|
||||
/// <summary>
|
||||
/// Requires that the file exists before allowing the user to pick it.
|
||||
/// </summary>
|
||||
Open = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Like Open, but allows picking multiple files to open.
|
||||
/// </summary>
|
||||
OpenMultiple,
|
||||
|
||||
/// <summary>
|
||||
/// Allows picking a nonexistent file, and prompts to overwrite if the file already exists.
|
||||
/// </summary>
|
||||
Save
|
||||
}
|
||||
}
|
||||
@@ -86,6 +86,7 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CefFileDialogMode.cs" />
|
||||
<Compile Include="IDialogHandler.cs" />
|
||||
<Compile Include="AddressChangedEventArgs.cs" />
|
||||
<Compile Include="IStringVisitor.cs" />
|
||||
|
||||
@@ -3,6 +3,6 @@ namespace CefSharp
|
||||
{
|
||||
public interface IDialogHandler
|
||||
{
|
||||
bool OnFileDialog(IWebBrowser browser, string title, string defaultFileName, List<string> acceptTypes, out List<string> result);
|
||||
bool OnFileDialog(IWebBrowser browser, CefFileDialogMode mode, string title, string defaultFileName, List<string> acceptTypes, out List<string> result);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user