Add CefFileDialogMode enum to IDialogHandler.OnFileDialog

This commit is contained in:
amaitland
2014-06-06 07:58:10 +10:00
parent a8074f8807
commit dc5fdaad9f
5 changed files with 24 additions and 3 deletions
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
+20
View File
@@ -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
}
}
+1
View File
@@ -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" />
+1 -1
View File
@@ -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);
}
}