Remove IBrowserHost.PrintToPdfAsync - code is now implemented in the PrintToPdfAsync extension method

This commit is contained in:
amaitland
2017-03-10 14:43:35 +10:00
parent 423fc2a806
commit 43aa8a35ea
4 changed files with 4 additions and 21 deletions
@@ -72,15 +72,6 @@ void CefBrowserHostWrapper::Print()
_browserHost->Print();
}
Task<bool>^ CefBrowserHostWrapper::PrintToPdfAsync(String^ path, PdfPrintSettings^ settings)
{
ThrowIfDisposed();
auto printToPdfTask = gcnew TaskPrintToPdfCallback();
PrintToPdf(path, settings, printToPdfTask);
return printToPdfTask->Task;
}
void CefBrowserHostWrapper::PrintToPdf(String^ path, PdfPrintSettings^ settings, IPrintToPdfCallback^ callback)
{
ThrowIfDisposed();
@@ -41,7 +41,6 @@ namespace CefSharp
public:
virtual void StartDownload(String^ url);
virtual void Print();
virtual Task<bool>^ PrintToPdfAsync(String^ path, PdfPrintSettings^ settings);
virtual void PrintToPdf(String^ path, PdfPrintSettings^ settings, IPrintToPdfCallback^ callback);
virtual void SetZoomLevel(double zoomLevel);
virtual Task<double>^ GetZoomLevelAsync();
-10
View File
@@ -189,16 +189,6 @@ namespace CefSharp
/// </summary>
void Print();
/// <summary>
/// Asynchronously prints the current browser contents to the Pdf file specified.
/// The caller is responsible for deleting the file when done.
/// </summary>
/// <param name="path">Output file location.</param>
/// <param name="settings">Print Settings.</param>
/// <returns>A task that represents the asynchronous print operation.
/// The result is true on success or false on failure to generate the Pdf.</returns>
Task<bool> PrintToPdfAsync(string path, PdfPrintSettings settings = null);
/// <summary>
/// Asynchronously prints the current browser contents to the Pdf file specified.
/// The caller is responsible for deleting the file when done.
+4 -1
View File
@@ -547,7 +547,10 @@ namespace CefSharp
var host = cefBrowser.GetHost();
ThrowExceptionIfBrowserHostNull(host);
return host.PrintToPdfAsync(path, settings);
var callback = new TaskPrintToPdfCallback();
host.PrintToPdf(path, settings, callback);
return callback.Task;
}
/// <summary>