From fdd967b3246fd7acb62b3b36165dcdad6cef7def Mon Sep 17 00:00:00 2001 From: Sylvain Hamel Date: Tue, 28 Oct 2014 13:10:04 -0400 Subject: [PATCH 01/17] expose SendMouseWheelEvent --- CefSharp.WinForms/ChromiumWebBrowser.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CefSharp.WinForms/ChromiumWebBrowser.cs b/CefSharp.WinForms/ChromiumWebBrowser.cs index 81ee95b51..7c94b7b62 100644 --- a/CefSharp.WinForms/ChromiumWebBrowser.cs +++ b/CefSharp.WinForms/ChromiumWebBrowser.cs @@ -122,6 +122,11 @@ namespace CefSharp.WinForms return managedCefBrowserAdapter.EvaluateScriptAsync(script, timeout); } + public void SendMouseWheelEvent(int x, int y, int deltaX, int deltaY) + { + managedCefBrowserAdapter.OnMouseWheel(x, y, deltaX, deltaY); + } + public event EventHandler LoadError; public event EventHandler FrameLoadStart; public event EventHandler FrameLoadEnd; From 736f949731198b1f3997a03d84a8af949bec919b Mon Sep 17 00:00:00 2001 From: amaitland Date: Wed, 12 Nov 2014 14:47:42 +1000 Subject: [PATCH 02/17] Add SendMouseWheelEvent to WPF Control Add SendMouseWheelEvent to IWebBrowser with xml comment --- CefSharp.Wpf/ChromiumWebBrowser.cs | 5 +++++ CefSharp/IWebBrowser.cs | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CefSharp.Wpf/ChromiumWebBrowser.cs b/CefSharp.Wpf/ChromiumWebBrowser.cs index d211041e0..4fa1ae587 100644 --- a/CefSharp.Wpf/ChromiumWebBrowser.cs +++ b/CefSharp.Wpf/ChromiumWebBrowser.cs @@ -913,6 +913,11 @@ namespace CefSharp.Wpf } } + public void SendMouseWheelEvent(int x, int y, int deltaX, int deltaY) + { + managedCefBrowserAdapter.OnMouseWheel(x, y, deltaX, deltaY); + } + protected void PopupMouseEnter(object sender, MouseEventArgs e) { Focus(); diff --git a/CefSharp/IWebBrowser.cs b/CefSharp/IWebBrowser.cs index 4b467ea14..4594cf7f2 100644 --- a/CefSharp/IWebBrowser.cs +++ b/CefSharp/IWebBrowser.cs @@ -256,6 +256,15 @@ namespace CefSharp /// /// Explicitly close the developer tools window if one exists for this browser instance. /// - void CloseDevTools(); + void CloseDevTools(); + + /// + /// Send a mouse wheel event to the browser. + /// + /// X-Axis coordinate relative to the upper-left corner of the view. + /// Y-Axis coordinate relative to the upper-left corner of the view. + /// Movement delta for X direction. + /// movement delta for Y direction. + void SendMouseWheelEvent(int x, int y, int deltaX, int deltaY); } } From ea0c9673caed2d5887244488810767934cae579d Mon Sep 17 00:00:00 2001 From: jankurianski Date: Fri, 14 Nov 2014 18:19:22 +1100 Subject: [PATCH 03/17] Added CefSharp.Offscreen, CefSharp.Offscreen.Example projects. --- .../CefSharp.Offscreen.Example.csproj | 118 +++++ CefSharp.Offscreen.Example/Program.cs | 81 +++ .../Properties/AssemblyInfo.cs | 13 + CefSharp.Offscreen.Example/app.config | 3 + CefSharp.Offscreen/CefSharp.Offscreen.csproj | 107 ++++ CefSharp.Offscreen/ChromiumWebBrowser.cs | 481 ++++++++++++++++++ CefSharp.Offscreen/Properties/AssemblyInfo.cs | 18 + CefSharp3.sln | 28 + 8 files changed, 849 insertions(+) create mode 100644 CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj create mode 100644 CefSharp.Offscreen.Example/Program.cs create mode 100644 CefSharp.Offscreen.Example/Properties/AssemblyInfo.cs create mode 100644 CefSharp.Offscreen.Example/app.config create mode 100644 CefSharp.Offscreen/CefSharp.Offscreen.csproj create mode 100644 CefSharp.Offscreen/ChromiumWebBrowser.cs create mode 100644 CefSharp.Offscreen/Properties/AssemblyInfo.cs diff --git a/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj b/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj new file mode 100644 index 000000000..03b4d102d --- /dev/null +++ b/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj @@ -0,0 +1,118 @@ + + + + + Debug + AnyCPU + {A4DEB90C-A529-4A93-ACE3-226A39EFCB00} + Exe + Properties + CefSharp.Offscreen.Example + CefSharp.Offscreen.Example + v4.0 + 512 + Client + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + MinimumRecommendedRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + MinimumRecommendedRules.ruleset + + + + + + + + + + + + + + + + + + {7b495581-2271-4f41-9476-acb86e8c864f} + CefSharp.Core + + + {a4394e7b-1155-43a6-989e-8ab72dddc9e4} + CefSharp.Example + + + {483b158d-f57d-49d9-9046-31e6a73f8a53} + CefSharp.Offscreen + + + {a55848cc-10e7-40cb-addb-04740b16dd43} + CefSharp + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + \ No newline at end of file diff --git a/CefSharp.Offscreen.Example/Program.cs b/CefSharp.Offscreen.Example/Program.cs new file mode 100644 index 000000000..cc60e7eff --- /dev/null +++ b/CefSharp.Offscreen.Example/Program.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Drawing; +using CefSharp.Example; + +namespace CefSharp.Offscreen.Example +{ + class Program + { + static ChromiumWebBrowser chrome; + + static void Main(string[] args) + { + const string testUrl = "https://www.google.com/"; + + Console.WriteLine("This example application will load {0}, take a screenshot, and save it to your desktop.", testUrl); + Console.WriteLine("You may see a lot of Chromium debugging output, please wait..."); + Console.WriteLine(); + + // You need to replace this with your own call to Cef.Initialize(); + CefExample.Init(); + + // Create the offscreen Chromium browser. + chrome = new ChromiumWebBrowser(); + + // An event that is fired when the first page is finished loading. + // This returns to us from another thread. + chrome.FrameLoadEnd += chrome_FrameLoadEnd; + + // Start loading the test URL in Chrome's thread. + chrome.Load(testUrl); + + // We have to wait for something, otherwise the process will exit too soon. + Console.ReadKey(); + + // Clean up Chromium objects. You need to call this in your application otherwise + // you will get a crash when closing. + Cef.Shutdown(); + } + + static void chrome_FrameLoadEnd(object sender, FrameLoadEndEventArgs e) + { + // Check to ensure it is the main frame which has finished loading + // (rather than an iframe within the main frame). + if (e.IsMainFrame) + { + // Remove the load event handler, because we only want one snapshot of the initial page. + chrome.FrameLoadEnd -= chrome_FrameLoadEnd; + + // Wait for the screenshot to be taken. + var task = chrome.ScreenshotAsync(); + task.Wait(); + + // Make a file to save it to (e.g. C:\Users\jan\Desktop\CefSharp screenshot.png) + string screenshotPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "CefSharp screenshot.png"); + + Console.WriteLine(); + Console.WriteLine("Screenshot ready. Saving to {0}", screenshotPath); + + // Save the Bitmap to the path. + // The image type is auto-detected via the ".png" extension. + task.Result.Save(screenshotPath); + + // We no longer need the Bitmap. + // Dispose it to avoid keeping the memory alive. Especially important in 32-bit applications. + task.Result.Dispose(); + + Console.WriteLine("Screenshot saved. Launching your default image viewer..."); + + // Tell Windows to launch the saved image. + Process.Start(screenshotPath); + + Console.WriteLine("Image viewer launched. Press any key to exit."); + } + } + } +} diff --git a/CefSharp.Offscreen.Example/Properties/AssemblyInfo.cs b/CefSharp.Offscreen.Example/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..26d041a75 --- /dev/null +++ b/CefSharp.Offscreen.Example/Properties/AssemblyInfo.cs @@ -0,0 +1,13 @@ +using CefSharp; +using System; +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("CefSharp.Offscreen.Example")] +[assembly: AssemblyCompany(AssemblyInfo.AssemblyCompany)] +[assembly: AssemblyProduct(AssemblyInfo.AssemblyProduct)] +[assembly: AssemblyCopyright(AssemblyInfo.AssemblyCopyright)] +[assembly: ComVisible(AssemblyInfo.ComVisible)] +[assembly: AssemblyVersion(AssemblyInfo.AssemblyVersion)] +[assembly: AssemblyFileVersion(AssemblyInfo.AssemblyFileVersion)] +[assembly: CLSCompliant(AssemblyInfo.ClsCompliant)] \ No newline at end of file diff --git a/CefSharp.Offscreen.Example/app.config b/CefSharp.Offscreen.Example/app.config new file mode 100644 index 000000000..2f7cce784 --- /dev/null +++ b/CefSharp.Offscreen.Example/app.config @@ -0,0 +1,3 @@ + + + diff --git a/CefSharp.Offscreen/CefSharp.Offscreen.csproj b/CefSharp.Offscreen/CefSharp.Offscreen.csproj new file mode 100644 index 000000000..f2929004a --- /dev/null +++ b/CefSharp.Offscreen/CefSharp.Offscreen.csproj @@ -0,0 +1,107 @@ + + + + + Debug + AnyCPU + {483B158D-F57D-49D9-9046-31E6A73F8A53} + Library + Properties + CefSharp.Offscreen + CefSharp.Offscreen + v4.0 + 512 + Client + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + bin\x64\Debug\CefSharp.Offscreen.XML + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + bin\x64\Release\CefSharp.Offscreen.XML + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + MinimumRecommendedRules.ruleset + bin\x86\Debug\CefSharp.Offscreen.XML + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + MinimumRecommendedRules.ruleset + bin\x86\Release\CefSharp.Offscreen.XML + + + + + + + + + + + + + + + + + + + + {7b495581-2271-4f41-9476-acb86e8c864f} + CefSharp.Core + + + {a55848cc-10e7-40cb-addb-04740b16dd43} + CefSharp + + + + + \ No newline at end of file diff --git a/CefSharp.Offscreen/ChromiumWebBrowser.cs b/CefSharp.Offscreen/ChromiumWebBrowser.cs new file mode 100644 index 000000000..d03906e00 --- /dev/null +++ b/CefSharp.Offscreen/ChromiumWebBrowser.cs @@ -0,0 +1,481 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Imaging; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Interop; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using CefSharp.Internals; + +namespace CefSharp.Offscreen +{ + /// + /// An offscreen instance of Chromium that you can use to take + /// snapshots or evaluate JavaScript. + /// + public class ChromiumWebBrowser : IRenderWebBrowser + { + ManagedCefBrowserAdapter managedCefBrowserAdapter; + + /// Contains the last rendering from Chromium. + Bitmap bitmap; + + /// Need a lock because the caller may be asking for the bitmap + /// while Chromium async rendering has returned on another thread. + object bitmapLock = new object(); + + /// Size of the Chromium viewport. + /// + /// This must be set to something other than 0x0 otherwise Chromium will not render, + /// and the ScreenshotAsync task will deadlock. + System.Drawing.Size size = new System.Drawing.Size(1366, 768); + + /// + /// Create a new offscreen Chromium with the initial URL of "about:blank". + /// + /// The browser settings to use. If null, the default settings are used. + public ChromiumWebBrowser(BrowserSettings browserSettings = null) + { + Cef.AddDisposable(this); + + managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this); + managedCefBrowserAdapter.CreateOffscreenBrowser(browserSettings ?? new BrowserSettings()); + } + + public void Dispose() + { + Cef.RemoveDisposable(this); + + if (bitmap != null) + { + bitmap.Dispose(); + bitmap = null; + } + + if (managedCefBrowserAdapter != null) + { + if (!managedCefBrowserAdapter.IsDisposed) + managedCefBrowserAdapter.Dispose(); + managedCefBrowserAdapter = null; + } + + GC.SuppressFinalize(this); + } + + /// + /// Get/set the size of the Chromium viewport, in pixels. + /// + /// This also changes the size of the next screenshot. + /// + public System.Drawing.Size Size + { + get { return size; } + set + { + if (size != value) + { + this.size = value; + managedCefBrowserAdapter.WasResized(); + } + } + } + + /// + /// Fired by a separate thread when Chrome has re-rendered. + /// This means that a Bitmap will be returned by ScreenshotOrNull(). + /// + public event EventHandler NewScreenshot; + + /// + /// Immediately returns a copy of the last rendering from Chrome, + /// or null if no rendering has occurred yet. + /// + /// Chrome also renders the page loading, so if you want to see a complete rendering, + /// only start this task once your page is loaded (which you can detect via FrameLoadEnd + /// or your own heuristics based on evaluating JavaScript). + /// + /// It is your responsibility to dispose the returned Bitmap. + /// + /// The bitmap size is determined by the Size property set earlier. + /// + public Bitmap ScreenshotOrNull() + { + lock (bitmapLock) + { + if (bitmap == null) + return null; + else + return new Bitmap(bitmap); + } + } + + /// + /// Starts a task that waits for the next rendering from Chrome. + /// + /// Chrome also renders the page loading, so if you want to see a complete rendering, + /// only start this task once your page is loaded (which you can detect via FrameLoadEnd + /// or your own heuristics based on evaluating JavaScript). + /// + /// It is your responsibility to dispose the returned Bitmap. + /// + /// The bitmap size is determined by the Size property set earlier. + /// + public Task ScreenshotAsync() + { + // Try our luck and see if there is already a screenshot, to save us creating a new thread for nothing. + Bitmap screenshot = ScreenshotOrNull(); + + Task task; + + if (screenshot != null) + { + var completionSource = new TaskCompletionSource(); + completionSource.SetResult(screenshot); + task = completionSource.Task; + } else { + // No existing screenshot, so wait for Chromium to render itself. + + // A wait handle, so the task knows when NewScreenshot has fired. + var waitForBitmap = new EventWaitHandle(false, EventResetMode.AutoReset); + + EventHandler newScreenshot = null; // otherwise we cannot reference ourselves in the anonymous method below + + newScreenshot = (sender, e) => + { + // Chromium has rendered. Tell the task about it. + NewScreenshot -= newScreenshot; + waitForBitmap.Set(); + }; + + NewScreenshot += newScreenshot; + + task = new Task(() => + { + // Wait in this thread for the NewScreenshot event to fire. + waitForBitmap.WaitOne(); + return ScreenshotOrNull(); + }); + + task.Start(); + } + + return task; + } + + public IJsDialogHandler JsDialogHandler { get; set; } + public IDialogHandler DialogHandler { get; set; } + public IDownloadHandler DownloadHandler { get; set; } + public IKeyboardHandler KeyboardHandler { get; set; } + public ILifeSpanHandler LifeSpanHandler { get; set; } + public IMenuHandler MenuHandler { get; set; } + public IRequestHandler RequestHandler { get; set; } + + public event EventHandler LoadError; + public event EventHandler FrameLoadStart; + public event EventHandler FrameLoadEnd; + public event EventHandler ConsoleMessage; + public event EventHandler BrowserInitialized; + public event EventHandler StatusMessage; + + public void ShowDevTools() + { + throw new NotImplementedException(); + } + + public void CloseDevTools() + { + throw new NotImplementedException(); + } + + public string Address { get; set; } + + public bool CanGoBack { get; private set; } + + public bool CanGoForward { get; private set; } + + public Task EvaluateScriptAsync(string script, TimeSpan? timeout = null) + { + return managedCefBrowserAdapter.EvaluateScriptAsync(script, timeout); + } + + public void ExecuteScriptAsync(string script) + { + managedCefBrowserAdapter.ExecuteScriptAsync(script); + } + + public void Find(int identifier, string searchText, bool forward, bool matchCase, bool findNext) + { + managedCefBrowserAdapter.Find(identifier, searchText, forward, matchCase, findNext); + } + + public void StopFinding(bool clearSelection) + { + managedCefBrowserAdapter.StopFinding(clearSelection); + } + + public bool IsBrowserInitialized { get; private set; } + + public bool IsLoading { get; set; } + + public void Load(string url) + { + this.Address = url; + managedCefBrowserAdapter.LoadUrl(Address); + } + + public void LoadHtml(string html, string url) + { + managedCefBrowserAdapter.LoadHtml(html, url); + } + + public void RegisterJsObject(string name, object objectToBind) + { + managedCefBrowserAdapter.RegisterJsObject(name, objectToBind); + } + + public void Stop() + { + managedCefBrowserAdapter.Stop(); + } + + public string Title { get; set; } + + public string TooltipText { get; set; } + + public bool CanReload { get; private set; } + + public Task GetSourceAsync() + { + var taskStringVisitor = new TaskStringVisitor(); + managedCefBrowserAdapter.GetSource(taskStringVisitor); + return taskStringVisitor.Task; + } + + public Task GetTextAsync() + { + var taskStringVisitor = new TaskStringVisitor(); + managedCefBrowserAdapter.GetText(taskStringVisitor); + return taskStringVisitor.Task; + } + + bool IWebBrowser.Focus() + { + // no control to focus for offscreen browser + return false; + } + + public void Reload() + { + Reload(false); + } + + public void Reload(bool ignoreCache) + { + managedCefBrowserAdapter.Reload(ignoreCache); + } + + public void ViewSource() + { + managedCefBrowserAdapter.ViewSource(); + } + + public void Print() + { + managedCefBrowserAdapter.Print(); + } + + public void Back() + { + managedCefBrowserAdapter.GoBack(); + } + + public void Forward() + { + managedCefBrowserAdapter.GoForward(); + } + + public double ZoomLevel + { + get { return managedCefBrowserAdapter.GetZoomLevel(); } + set { managedCefBrowserAdapter.SetZoomLevel(value); } + } + + #region IRenderWebBrowser (rendering to bitmap; derived from CefSharp.Wpf.ChromiumWebBrowser) + /// The bitmap buffer is 32 BPP. + int IRenderWebBrowser.BytesPerPixel + { + get { return 4; } + } + + void IRenderWebBrowser.ClearBitmap(BitmapInfo bitmapInfo) + { + lock (bitmapLock) + { + if (bitmap != null) + bitmap.Dispose(); + this.bitmap = null; + } + } + + int IRenderWebBrowser.Width + { + get { return size.Width; } + } + + int IRenderWebBrowser.Height + { + get { return size.Height; } + } + + void IRenderWebBrowser.InvokeRenderAsync(BitmapInfo bitmapInfo) + { + ((IRenderWebBrowser)this).SetBitmap(bitmapInfo); + } + + void IRenderWebBrowser.SetBitmap(BitmapInfo bitmapInfo) + { + lock (bitmapLock) + { + ((IRenderWebBrowser)this).ClearBitmap(bitmapInfo); + lock (bitmapInfo.BitmapLock) + { + var stride = bitmapInfo.Width * ((IRenderWebBrowser)this).BytesPerPixel; + + this.bitmap = BitmapSourceToBitmap2(Imaging.CreateBitmapSourceFromMemorySection(bitmapInfo.FileMappingHandle, + bitmapInfo.Width, bitmapInfo.Height, PixelFormats.Bgra32, stride, 0)); + + if (NewScreenshot != null) + NewScreenshot(this, EventArgs.Empty); + } + } + } + + /// http://stackoverflow.com/a/5709472/450141 + static System.Drawing.Bitmap BitmapSourceToBitmap2(BitmapSource srs) + { + Bitmap bmp = new Bitmap( + srs.PixelWidth, + srs.PixelHeight, + System.Drawing.Imaging.PixelFormat.Format32bppPArgb); + BitmapData data = bmp.LockBits( + new Rectangle(System.Drawing.Point.Empty, bmp.Size), + ImageLockMode.WriteOnly, + System.Drawing.Imaging.PixelFormat.Format32bppPArgb); + srs.CopyPixels( + Int32Rect.Empty, + data.Scan0, + data.Height * data.Stride, + data.Stride); + bmp.UnlockBits(data); + return bmp; + } + + void IRenderWebBrowser.SetCursor(IntPtr cursor) + { + } + + void IRenderWebBrowser.SetPopupIsOpen(bool show) + { + } + + void IRenderWebBrowser.SetPopupSizeAndPosition(int width, int height, int x, int y) + { + } + #endregion + + #region IWebBrowserInternal (notifications from CEF to C#; derived from CefSharp.Wpf.ChromiumWebBrowser) + void IWebBrowserInternal.OnConsoleMessage(string message, string source, int line) + { + var handler = ConsoleMessage; + if (handler != null) + { + handler(this, new ConsoleMessageEventArgs(message, source, line)); + } + } + + void IWebBrowserInternal.OnFrameLoadStart(string url, bool isMainFrame) + { + var handler = FrameLoadStart; + if (handler != null) + { + handler(this, new FrameLoadStartEventArgs(url, isMainFrame)); + } + } + + void IWebBrowserInternal.OnFrameLoadEnd(string url, bool isMainFrame, int httpStatusCode) + { + var handler = FrameLoadEnd; + if (handler != null) + { + handler(this, new FrameLoadEndEventArgs(url, isMainFrame, httpStatusCode)); + } + } + + void IWebBrowserInternal.OnInitialized() + { + this.IsBrowserInitialized = true; + + var handler = BrowserInitialized; + if (handler != null) + { + handler(this, EventArgs.Empty); + } + } + + void IWebBrowserInternal.OnLoadError(string url, CefErrorCode errorCode, string errorText) + { + var handler = LoadError; + if (handler != null) + { + handler(this, new LoadErrorEventArgs(url, errorCode, errorText)); + } + } + + void IWebBrowserInternal.OnTakeFocus(bool next) + { + throw new NotImplementedException(); + } + + void IWebBrowserInternal.OnStatusMessage(string value) + { + var handler = StatusMessage; + if (handler != null) + { + handler(this, new StatusMessageEventArgs(value)); + } + } + + void IWebBrowserInternal.SetAddress(string address) + { + this.Address = address; + } + + void IWebBrowserInternal.SetIsLoading(bool isloading) + { + this.IsLoading = isloading; + } + + void IWebBrowserInternal.SetNavState(bool canGoBack, bool canGoForward, bool canReload) + { + this.CanGoBack = canGoBack; + this.CanGoForward = canGoForward; + this.CanReload = canReload; + } + + void IWebBrowserInternal.SetTitle(string title) + { + this.Title = title; + } + + void IWebBrowserInternal.SetTooltipText(string tooltipText) + { + this.TooltipText = tooltipText; + } + #endregion + } +} diff --git a/CefSharp.Offscreen/Properties/AssemblyInfo.cs b/CefSharp.Offscreen/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..48890c443 --- /dev/null +++ b/CefSharp.Offscreen/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using CefSharp; +using System; +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("CefSharp.Offscreen")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: AssemblyCompany(AssemblyInfo.AssemblyCompany)] +[assembly: AssemblyProduct(AssemblyInfo.AssemblyProduct)] +[assembly: AssemblyCopyright(AssemblyInfo.AssemblyCopyright)] +[assembly: ComVisible(AssemblyInfo.ComVisible)] +[assembly: AssemblyVersion(AssemblyInfo.AssemblyVersion)] +[assembly: AssemblyFileVersion(AssemblyInfo.AssemblyFileVersion)] +[assembly: CLSCompliant(AssemblyInfo.ClsCompliant)] diff --git a/CefSharp3.sln b/CefSharp3.sln index 061c896de..1ed03c3f2 100644 --- a/CefSharp3.sln +++ b/CefSharp3.sln @@ -65,6 +65,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{9AD9C469 build.ps1 = build.ps1 EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.Offscreen", "CefSharp.Offscreen\CefSharp.Offscreen.csproj", "{483B158D-F57D-49D9-9046-31E6A73F8A53}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.Offscreen.Example", "CefSharp.Offscreen.Example\CefSharp.Offscreen.Example.csproj", "{A4DEB90C-A529-4A93-ACE3-226A39EFCB00}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Mixed Platforms = Debug|Mixed Platforms @@ -195,6 +199,30 @@ Global {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Release|Win32.Build.0 = Release|Win32 {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Release|x64.ActiveCfg = Release|x64 {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Release|x64.Build.0 = Release|x64 + {483B158D-F57D-49D9-9046-31E6A73F8A53}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {483B158D-F57D-49D9-9046-31E6A73F8A53}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {483B158D-F57D-49D9-9046-31E6A73F8A53}.Debug|Win32.ActiveCfg = Debug|x86 + {483B158D-F57D-49D9-9046-31E6A73F8A53}.Debug|Win32.Build.0 = Debug|x86 + {483B158D-F57D-49D9-9046-31E6A73F8A53}.Debug|x64.ActiveCfg = Debug|x64 + {483B158D-F57D-49D9-9046-31E6A73F8A53}.Debug|x64.Build.0 = Debug|x64 + {483B158D-F57D-49D9-9046-31E6A73F8A53}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {483B158D-F57D-49D9-9046-31E6A73F8A53}.Release|Mixed Platforms.Build.0 = Release|x86 + {483B158D-F57D-49D9-9046-31E6A73F8A53}.Release|Win32.ActiveCfg = Release|x86 + {483B158D-F57D-49D9-9046-31E6A73F8A53}.Release|Win32.Build.0 = Release|x86 + {483B158D-F57D-49D9-9046-31E6A73F8A53}.Release|x64.ActiveCfg = Release|x64 + {483B158D-F57D-49D9-9046-31E6A73F8A53}.Release|x64.Build.0 = Release|x64 + {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Debug|Win32.ActiveCfg = Debug|x86 + {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Debug|Win32.Build.0 = Debug|x86 + {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Debug|x64.ActiveCfg = Debug|x64 + {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Debug|x64.Build.0 = Debug|x64 + {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Release|Mixed Platforms.Build.0 = Release|x86 + {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Release|Win32.ActiveCfg = Release|x86 + {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Release|Win32.Build.0 = Release|x86 + {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Release|x64.ActiveCfg = Release|x64 + {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 8a0a34aa9dd481a70135a47a907a7c86af853918 Mon Sep 17 00:00:00 2001 From: jankurianski Date: Fri, 14 Nov 2014 18:48:46 +1100 Subject: [PATCH 04/17] Added copyrights, missing methods, suppress XML comment warnings. --- CefSharp.Offscreen.Example/Program.cs | 10 +++++----- CefSharp.Offscreen/CefSharp.Offscreen.csproj | 1 + CefSharp.Offscreen/ChromiumWebBrowser.cs | 14 ++++++++++---- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CefSharp.Offscreen.Example/Program.cs b/CefSharp.Offscreen.Example/Program.cs index cc60e7eff..95e78130c 100644 --- a/CefSharp.Offscreen.Example/Program.cs +++ b/CefSharp.Offscreen.Example/Program.cs @@ -1,10 +1,10 @@ -using System; -using System.Collections.Generic; +// Copyright © 2010-2014 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; using System.Diagnostics; using System.IO; -using System.Linq; -using System.Text; -using System.Drawing; using CefSharp.Example; namespace CefSharp.Offscreen.Example diff --git a/CefSharp.Offscreen/CefSharp.Offscreen.csproj b/CefSharp.Offscreen/CefSharp.Offscreen.csproj index f2929004a..3a1b6cf5a 100644 --- a/CefSharp.Offscreen/CefSharp.Offscreen.csproj +++ b/CefSharp.Offscreen/CefSharp.Offscreen.csproj @@ -59,6 +59,7 @@ prompt MinimumRecommendedRules.ruleset bin\x86\Debug\CefSharp.Offscreen.XML + 1591 bin\x86\Release\ diff --git a/CefSharp.Offscreen/ChromiumWebBrowser.cs b/CefSharp.Offscreen/ChromiumWebBrowser.cs index d03906e00..f0b882a18 100644 --- a/CefSharp.Offscreen/ChromiumWebBrowser.cs +++ b/CefSharp.Offscreen/ChromiumWebBrowser.cs @@ -1,9 +1,10 @@ -using System; -using System.Collections.Generic; +// Copyright © 2010-2014 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; using System.Drawing; using System.Drawing.Imaging; -using System.Linq; -using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows; @@ -305,6 +306,11 @@ namespace CefSharp.Offscreen set { managedCefBrowserAdapter.SetZoomLevel(value); } } + public void SendMouseWheelEvent(int x, int y, int deltaX, int deltaY) + { + managedCefBrowserAdapter.OnMouseWheel(x, y, deltaX, deltaY); + } + #region IRenderWebBrowser (rendering to bitmap; derived from CefSharp.Wpf.ChromiumWebBrowser) /// The bitmap buffer is 32 BPP. int IRenderWebBrowser.BytesPerPixel From 6268a2ecfd0845a5d47f024a9b6ac0ffe98268a9 Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 18 Nov 2014 11:58:25 +1000 Subject: [PATCH 05/17] First attempt for skipping nupkg generation for PR's --- build.ps1 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.ps1 b/build.ps1 index 6cc946469..ce64baee1 100644 --- a/build.ps1 +++ b/build.ps1 @@ -19,6 +19,12 @@ if (Test-Path Env:\APPVEYOR_BUILD_VERSION) $Version = $env:APPVEYOR_BUILD_VERSION } +if (Test-Path Env:\APPVEYOR_PULL_REQUEST_NUMBER) +{ + Write-Diagnostic "Pr Number: $env:APPVEYOR_PULL_REQUEST_NUMBER" + $SkipNugetForPr = $true +} + # https://github.com/jbake/Powershell_scripts/blob/master/Invoke-BatchFile.ps1 function Invoke-BatchFile { @@ -218,6 +224,11 @@ function NugetPackageRestore function Nupkg { + if($SkipNugetForPr) + { + return; + } + $nuget = Join-Path $WorkingDir .\nuget\NuGet.exe if(-not (Test-Path $nuget)) { Die "Please install nuget. More information available at: http://docs.nuget.org/docs/start-here/installing-nuget" From 732cf49d9d5efafeb6d71d11b0783746ae3b7441 Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 18 Nov 2014 12:22:21 +1000 Subject: [PATCH 06/17] Write-Diagnostic was inaccessible so created CheckIfPrBuild function and executed later --- build.ps1 | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/build.ps1 b/build.ps1 index ce64baee1..954cd1506 100644 --- a/build.ps1 +++ b/build.ps1 @@ -4,7 +4,7 @@ param( [string] $Target = "nupkg", [Parameter(Position = 1)] [string] $Version = "37.0.0-pre01", - [Parameter(Position = 2)] + [Parameter(Position = 2)] [string] $AssemlyVersion = "37.0.0", [Parameter(Position = 3)] [string] $RedistVersion = "3.2062.1898" @@ -19,12 +19,6 @@ if (Test-Path Env:\APPVEYOR_BUILD_VERSION) $Version = $env:APPVEYOR_BUILD_VERSION } -if (Test-Path Env:\APPVEYOR_PULL_REQUEST_NUMBER) -{ - Write-Diagnostic "Pr Number: $env:APPVEYOR_PULL_REQUEST_NUMBER" - $SkipNugetForPr = $true -} - # https://github.com/jbake/Powershell_scripts/blob/master/Invoke-BatchFile.ps1 function Invoke-BatchFile { @@ -224,11 +218,11 @@ function NugetPackageRestore function Nupkg { - if($SkipNugetForPr) - { - return; - } - + if($SkipNugetForPr) + { + return; + } + $nuget = Join-Path $WorkingDir .\nuget\NuGet.exe if(-not (Test-Path $nuget)) { Die "Please install nuget. More information available at: http://docs.nuget.org/docs/start-here/installing-nuget" @@ -272,6 +266,17 @@ function WriteAssemblyVersion $NewString | Set-Content $Filename -Encoding UTF8 } +function CheckIfPrBuild() +{ + if (Test-Path Env:\APPVEYOR_PULL_REQUEST_NUMBER) + { + Write-Diagnostic "Pr Number: $env:APPVEYOR_PULL_REQUEST_NUMBER" + $SkipNugetForPr = $true + } +} + +CheckIfPrBuild + DownloadNuget NugetPackageRestore @@ -280,7 +285,7 @@ WriteAssemblyVersion switch -Exact ($Target) { "nupkg" - { + { #VSX v120 VSX v110 Nupkg From 59636207c8f6deb16a3c23b23c2cc66be36d601e Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 18 Nov 2014 12:58:18 +1000 Subject: [PATCH 07/17] Add cef.redist packages --- CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj | 1 + CefSharp.Offscreen.Example/packages.config | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 CefSharp.Offscreen.Example/packages.config diff --git a/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj b/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj index 03b4d102d..0468c3b65 100644 --- a/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj +++ b/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj @@ -102,6 +102,7 @@ + diff --git a/CefSharp.Offscreen.Example/packages.config b/CefSharp.Offscreen.Example/packages.config new file mode 100644 index 000000000..084feef8e --- /dev/null +++ b/CefSharp.Offscreen.Example/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file From 4376dc83505e1e498775ad22fdef3aa303ae0a15 Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 18 Nov 2014 12:59:20 +1000 Subject: [PATCH 08/17] Cleanup references --- CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj | 4 ---- CefSharp.Offscreen/CefSharp.Offscreen.csproj | 4 ---- 2 files changed, 8 deletions(-) diff --git a/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj b/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj index 0468c3b65..502e80255 100644 --- a/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj +++ b/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj @@ -72,11 +72,7 @@ - - - - diff --git a/CefSharp.Offscreen/CefSharp.Offscreen.csproj b/CefSharp.Offscreen/CefSharp.Offscreen.csproj index 3a1b6cf5a..b936377d0 100644 --- a/CefSharp.Offscreen/CefSharp.Offscreen.csproj +++ b/CefSharp.Offscreen/CefSharp.Offscreen.csproj @@ -76,11 +76,7 @@ - - - - From 1b614310fdbf7ef9e330562bba2029aa6518a316 Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 18 Nov 2014 13:01:23 +1000 Subject: [PATCH 09/17] Resharper inspired cleanup --- CefSharp.Offscreen/ChromiumWebBrowser.cs | 44 +++++++++++++----------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/CefSharp.Offscreen/ChromiumWebBrowser.cs b/CefSharp.Offscreen/ChromiumWebBrowser.cs index f0b882a18..2db984ef7 100644 --- a/CefSharp.Offscreen/ChromiumWebBrowser.cs +++ b/CefSharp.Offscreen/ChromiumWebBrowser.cs @@ -21,20 +21,20 @@ namespace CefSharp.Offscreen /// public class ChromiumWebBrowser : IRenderWebBrowser { - ManagedCefBrowserAdapter managedCefBrowserAdapter; + private ManagedCefBrowserAdapter managedCefBrowserAdapter; /// Contains the last rendering from Chromium. - Bitmap bitmap; + private Bitmap bitmap; /// Need a lock because the caller may be asking for the bitmap /// while Chromium async rendering has returned on another thread. - object bitmapLock = new object(); + private readonly object bitmapLock = new object(); /// Size of the Chromium viewport. /// /// This must be set to something other than 0x0 otherwise Chromium will not render, /// and the ScreenshotAsync task will deadlock. - System.Drawing.Size size = new System.Drawing.Size(1366, 768); + private System.Drawing.Size size = new System.Drawing.Size(1366, 768); /// /// Create a new offscreen Chromium with the initial URL of "about:blank". @@ -80,7 +80,7 @@ namespace CefSharp.Offscreen { if (size != value) { - this.size = value; + size = value; managedCefBrowserAdapter.WasResized(); } } @@ -129,7 +129,7 @@ namespace CefSharp.Offscreen public Task ScreenshotAsync() { // Try our luck and see if there is already a screenshot, to save us creating a new thread for nothing. - Bitmap screenshot = ScreenshotOrNull(); + var screenshot = ScreenshotOrNull(); Task task; @@ -225,7 +225,7 @@ namespace CefSharp.Offscreen public void Load(string url) { - this.Address = url; + Address = url; managedCefBrowserAdapter.LoadUrl(Address); } @@ -324,7 +324,7 @@ namespace CefSharp.Offscreen { if (bitmap != null) bitmap.Dispose(); - this.bitmap = null; + bitmap = null; } } @@ -352,7 +352,7 @@ namespace CefSharp.Offscreen { var stride = bitmapInfo.Width * ((IRenderWebBrowser)this).BytesPerPixel; - this.bitmap = BitmapSourceToBitmap2(Imaging.CreateBitmapSourceFromMemorySection(bitmapInfo.FileMappingHandle, + bitmap = BitmapSourceToBitmap2(Imaging.CreateBitmapSourceFromMemorySection(bitmapInfo.FileMappingHandle, bitmapInfo.Width, bitmapInfo.Height, PixelFormats.Bgra32, stride, 0)); if (NewScreenshot != null) @@ -361,14 +361,18 @@ namespace CefSharp.Offscreen } } - /// http://stackoverflow.com/a/5709472/450141 - static System.Drawing.Bitmap BitmapSourceToBitmap2(BitmapSource srs) + /// + /// http://stackoverflow.com/a/5709472/450141 + /// + /// BitmapSource + /// Bitmap + private static Bitmap BitmapSourceToBitmap2(BitmapSource srs) { - Bitmap bmp = new Bitmap( + var bmp = new Bitmap( srs.PixelWidth, srs.PixelHeight, System.Drawing.Imaging.PixelFormat.Format32bppPArgb); - BitmapData data = bmp.LockBits( + var data = bmp.LockBits( new Rectangle(System.Drawing.Point.Empty, bmp.Size), ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppPArgb); @@ -424,7 +428,7 @@ namespace CefSharp.Offscreen void IWebBrowserInternal.OnInitialized() { - this.IsBrowserInitialized = true; + IsBrowserInitialized = true; var handler = BrowserInitialized; if (handler != null) @@ -463,24 +467,24 @@ namespace CefSharp.Offscreen void IWebBrowserInternal.SetIsLoading(bool isloading) { - this.IsLoading = isloading; + IsLoading = isloading; } void IWebBrowserInternal.SetNavState(bool canGoBack, bool canGoForward, bool canReload) { - this.CanGoBack = canGoBack; - this.CanGoForward = canGoForward; - this.CanReload = canReload; + CanGoBack = canGoBack; + CanGoForward = canGoForward; + CanReload = canReload; } void IWebBrowserInternal.SetTitle(string title) { - this.Title = title; + Title = title; } void IWebBrowserInternal.SetTooltipText(string tooltipText) { - this.TooltipText = tooltipText; + TooltipText = tooltipText; } #endregion } From 8b45904fa7361fc3a0cbd0a2da7c994ca6fdf660 Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 18 Nov 2014 13:03:53 +1000 Subject: [PATCH 10/17] Event handling best practice Also make consistent --- CefSharp.Offscreen/ChromiumWebBrowser.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CefSharp.Offscreen/ChromiumWebBrowser.cs b/CefSharp.Offscreen/ChromiumWebBrowser.cs index 2db984ef7..4d36c086f 100644 --- a/CefSharp.Offscreen/ChromiumWebBrowser.cs +++ b/CefSharp.Offscreen/ChromiumWebBrowser.cs @@ -355,8 +355,11 @@ namespace CefSharp.Offscreen bitmap = BitmapSourceToBitmap2(Imaging.CreateBitmapSourceFromMemorySection(bitmapInfo.FileMappingHandle, bitmapInfo.Width, bitmapInfo.Height, PixelFormats.Bgra32, stride, 0)); - if (NewScreenshot != null) - NewScreenshot(this, EventArgs.Empty); + var handler = NewScreenshot; + if (handler != null) + { + handler(this, EventArgs.Empty); + } } } } From ce874e923165340d8c80716b9d6f1b37d5d55948 Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 18 Nov 2014 13:05:31 +1000 Subject: [PATCH 11/17] More trivial code cleanup - keeps things consistent with other examples --- CefSharp.Offscreen.Example/Program.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CefSharp.Offscreen.Example/Program.cs b/CefSharp.Offscreen.Example/Program.cs index 95e78130c..50aa330d1 100644 --- a/CefSharp.Offscreen.Example/Program.cs +++ b/CefSharp.Offscreen.Example/Program.cs @@ -9,11 +9,11 @@ using CefSharp.Example; namespace CefSharp.Offscreen.Example { - class Program + public class Program { - static ChromiumWebBrowser chrome; + private static ChromiumWebBrowser browser; - static void Main(string[] args) + public static void Main(string[] args) { const string testUrl = "https://www.google.com/"; @@ -25,14 +25,14 @@ namespace CefSharp.Offscreen.Example CefExample.Init(); // Create the offscreen Chromium browser. - chrome = new ChromiumWebBrowser(); + browser = new ChromiumWebBrowser(); // An event that is fired when the first page is finished loading. // This returns to us from another thread. - chrome.FrameLoadEnd += chrome_FrameLoadEnd; + browser.FrameLoadEnd += BrowserFrameLoadEnd; // Start loading the test URL in Chrome's thread. - chrome.Load(testUrl); + browser.Load(testUrl); // We have to wait for something, otherwise the process will exit too soon. Console.ReadKey(); @@ -42,21 +42,21 @@ namespace CefSharp.Offscreen.Example Cef.Shutdown(); } - static void chrome_FrameLoadEnd(object sender, FrameLoadEndEventArgs e) + private static void BrowserFrameLoadEnd(object sender, FrameLoadEndEventArgs e) { // Check to ensure it is the main frame which has finished loading // (rather than an iframe within the main frame). if (e.IsMainFrame) { // Remove the load event handler, because we only want one snapshot of the initial page. - chrome.FrameLoadEnd -= chrome_FrameLoadEnd; + browser.FrameLoadEnd -= BrowserFrameLoadEnd; // Wait for the screenshot to be taken. - var task = chrome.ScreenshotAsync(); + var task = browser.ScreenshotAsync(); task.Wait(); // Make a file to save it to (e.g. C:\Users\jan\Desktop\CefSharp screenshot.png) - string screenshotPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "CefSharp screenshot.png"); + var screenshotPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "CefSharp screenshot.png"); Console.WriteLine(); Console.WriteLine("Screenshot ready. Saving to {0}", screenshotPath); From c8fb518f4ce0f866382d1da8bf901caff82d1534 Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 18 Nov 2014 13:08:31 +1000 Subject: [PATCH 12/17] Formatting --- CefSharp.Offscreen/ChromiumWebBrowser.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CefSharp.Offscreen/ChromiumWebBrowser.cs b/CefSharp.Offscreen/ChromiumWebBrowser.cs index 4d36c086f..ff4d124c6 100644 --- a/CefSharp.Offscreen/ChromiumWebBrowser.cs +++ b/CefSharp.Offscreen/ChromiumWebBrowser.cs @@ -138,7 +138,9 @@ namespace CefSharp.Offscreen var completionSource = new TaskCompletionSource(); completionSource.SetResult(screenshot); task = completionSource.Task; - } else { + } + else + { // No existing screenshot, so wait for Chromium to render itself. // A wait handle, so the task knows when NewScreenshot has fired. From 75f3b9d820ab30267464634b89d7122dc617319d Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 18 Nov 2014 13:10:52 +1000 Subject: [PATCH 13/17] Remove `AnyCPU` as option from project and solution --- .../CefSharp.Offscreen.Example.csproj | 21 +------- CefSharp.Offscreen/CefSharp.Offscreen.csproj | 19 +------ CefSharp3.sln | 54 +------------------ 3 files changed, 3 insertions(+), 91 deletions(-) diff --git a/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj b/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj index 502e80255..6ae35c9c9 100644 --- a/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj +++ b/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj @@ -3,7 +3,7 @@ Debug - AnyCPU + x86 {A4DEB90C-A529-4A93-ACE3-226A39EFCB00} Exe Properties @@ -13,25 +13,6 @@ 512 Client - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true bin\x64\Debug\ diff --git a/CefSharp.Offscreen/CefSharp.Offscreen.csproj b/CefSharp.Offscreen/CefSharp.Offscreen.csproj index b936377d0..4268fe092 100644 --- a/CefSharp.Offscreen/CefSharp.Offscreen.csproj +++ b/CefSharp.Offscreen/CefSharp.Offscreen.csproj @@ -3,7 +3,7 @@ Debug - AnyCPU + x86 {483B158D-F57D-49D9-9046-31E6A73F8A53} Library Properties @@ -13,23 +13,6 @@ 512 Client - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true bin\x64\Debug\ diff --git a/CefSharp3.sln b/CefSharp3.sln index 1ed03c3f2..49ec754cc 100644 --- a/CefSharp3.sln +++ b/CefSharp3.sln @@ -1,8 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30723.0 -MinimumVisualStudioVersion = 10.0.40219.1 +# Visual Studio 2012 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.Test", "CefSharp.Test\CefSharp.Test.csproj", "{7A4D5447-183B-4A11-8E63-9848991B46FF}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.Example", "CefSharp.Example\CefSharp.Example.csproj", "{A4394E7B-1155-43A6-989E-8AB72DDDC9E4}" @@ -71,154 +69,104 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.Offscreen.Example" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Mixed Platforms = Debug|Mixed Platforms Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 - Release|Mixed Platforms = Release|Mixed Platforms Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7A4D5447-183B-4A11-8E63-9848991B46FF}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {7A4D5447-183B-4A11-8E63-9848991B46FF}.Debug|Mixed Platforms.Build.0 = Debug|x86 {7A4D5447-183B-4A11-8E63-9848991B46FF}.Debug|Win32.ActiveCfg = Debug|x86 {7A4D5447-183B-4A11-8E63-9848991B46FF}.Debug|Win32.Build.0 = Debug|x86 {7A4D5447-183B-4A11-8E63-9848991B46FF}.Debug|x64.ActiveCfg = Debug|x64 {7A4D5447-183B-4A11-8E63-9848991B46FF}.Debug|x64.Build.0 = Debug|x64 - {7A4D5447-183B-4A11-8E63-9848991B46FF}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {7A4D5447-183B-4A11-8E63-9848991B46FF}.Release|Mixed Platforms.Build.0 = Release|x86 {7A4D5447-183B-4A11-8E63-9848991B46FF}.Release|Win32.ActiveCfg = Release|x86 {7A4D5447-183B-4A11-8E63-9848991B46FF}.Release|Win32.Build.0 = Release|x86 {7A4D5447-183B-4A11-8E63-9848991B46FF}.Release|x64.ActiveCfg = Release|x64 {7A4D5447-183B-4A11-8E63-9848991B46FF}.Release|x64.Build.0 = Release|x64 - {A4394E7B-1155-43A6-989E-8AB72DDDC9E4}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {A4394E7B-1155-43A6-989E-8AB72DDDC9E4}.Debug|Mixed Platforms.Build.0 = Debug|x86 {A4394E7B-1155-43A6-989E-8AB72DDDC9E4}.Debug|Win32.ActiveCfg = Debug|x86 {A4394E7B-1155-43A6-989E-8AB72DDDC9E4}.Debug|Win32.Build.0 = Debug|x86 {A4394E7B-1155-43A6-989E-8AB72DDDC9E4}.Debug|x64.ActiveCfg = Debug|x64 {A4394E7B-1155-43A6-989E-8AB72DDDC9E4}.Debug|x64.Build.0 = Debug|x64 - {A4394E7B-1155-43A6-989E-8AB72DDDC9E4}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {A4394E7B-1155-43A6-989E-8AB72DDDC9E4}.Release|Mixed Platforms.Build.0 = Release|x86 {A4394E7B-1155-43A6-989E-8AB72DDDC9E4}.Release|Win32.ActiveCfg = Release|x86 {A4394E7B-1155-43A6-989E-8AB72DDDC9E4}.Release|Win32.Build.0 = Release|x86 {A4394E7B-1155-43A6-989E-8AB72DDDC9E4}.Release|x64.ActiveCfg = Release|x64 {A4394E7B-1155-43A6-989E-8AB72DDDC9E4}.Release|x64.Build.0 = Release|x64 - {4828DAEC-EF99-4553-B674-4374F77C6D66}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {4828DAEC-EF99-4553-B674-4374F77C6D66}.Debug|Mixed Platforms.Build.0 = Debug|x86 {4828DAEC-EF99-4553-B674-4374F77C6D66}.Debug|Win32.ActiveCfg = Debug|x86 {4828DAEC-EF99-4553-B674-4374F77C6D66}.Debug|Win32.Build.0 = Debug|x86 {4828DAEC-EF99-4553-B674-4374F77C6D66}.Debug|x64.ActiveCfg = Debug|x64 {4828DAEC-EF99-4553-B674-4374F77C6D66}.Debug|x64.Build.0 = Debug|x64 - {4828DAEC-EF99-4553-B674-4374F77C6D66}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {4828DAEC-EF99-4553-B674-4374F77C6D66}.Release|Mixed Platforms.Build.0 = Release|x86 {4828DAEC-EF99-4553-B674-4374F77C6D66}.Release|Win32.ActiveCfg = Release|x86 {4828DAEC-EF99-4553-B674-4374F77C6D66}.Release|Win32.Build.0 = Release|x86 {4828DAEC-EF99-4553-B674-4374F77C6D66}.Release|x64.ActiveCfg = Release|x64 {4828DAEC-EF99-4553-B674-4374F77C6D66}.Release|x64.Build.0 = Release|x64 - {E6CB3790-F267-4AC7-892C-2620737682CA}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {E6CB3790-F267-4AC7-892C-2620737682CA}.Debug|Mixed Platforms.Build.0 = Debug|x86 {E6CB3790-F267-4AC7-892C-2620737682CA}.Debug|Win32.ActiveCfg = Debug|x86 {E6CB3790-F267-4AC7-892C-2620737682CA}.Debug|Win32.Build.0 = Debug|x86 {E6CB3790-F267-4AC7-892C-2620737682CA}.Debug|x64.ActiveCfg = Debug|x64 {E6CB3790-F267-4AC7-892C-2620737682CA}.Debug|x64.Build.0 = Debug|x64 - {E6CB3790-F267-4AC7-892C-2620737682CA}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {E6CB3790-F267-4AC7-892C-2620737682CA}.Release|Mixed Platforms.Build.0 = Release|x86 {E6CB3790-F267-4AC7-892C-2620737682CA}.Release|Win32.ActiveCfg = Release|x86 {E6CB3790-F267-4AC7-892C-2620737682CA}.Release|Win32.Build.0 = Release|x86 {E6CB3790-F267-4AC7-892C-2620737682CA}.Release|x64.ActiveCfg = Release|x64 {E6CB3790-F267-4AC7-892C-2620737682CA}.Release|x64.Build.0 = Release|x64 - {23EE5140-2C2C-4B53-A954-10B08DCA6BD6}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {23EE5140-2C2C-4B53-A954-10B08DCA6BD6}.Debug|Mixed Platforms.Build.0 = Debug|x86 {23EE5140-2C2C-4B53-A954-10B08DCA6BD6}.Debug|Win32.ActiveCfg = Debug|x86 {23EE5140-2C2C-4B53-A954-10B08DCA6BD6}.Debug|Win32.Build.0 = Debug|x86 {23EE5140-2C2C-4B53-A954-10B08DCA6BD6}.Debug|x64.ActiveCfg = Debug|x64 {23EE5140-2C2C-4B53-A954-10B08DCA6BD6}.Debug|x64.Build.0 = Debug|x64 - {23EE5140-2C2C-4B53-A954-10B08DCA6BD6}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {23EE5140-2C2C-4B53-A954-10B08DCA6BD6}.Release|Mixed Platforms.Build.0 = Release|x86 {23EE5140-2C2C-4B53-A954-10B08DCA6BD6}.Release|Win32.ActiveCfg = Release|x86 {23EE5140-2C2C-4B53-A954-10B08DCA6BD6}.Release|Win32.Build.0 = Release|x86 {23EE5140-2C2C-4B53-A954-10B08DCA6BD6}.Release|x64.ActiveCfg = Release|x64 {23EE5140-2C2C-4B53-A954-10B08DCA6BD6}.Release|x64.Build.0 = Release|x64 - {882505AD-246D-402A-8414-347EFB8E2C8D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {882505AD-246D-402A-8414-347EFB8E2C8D}.Debug|Mixed Platforms.Build.0 = Debug|x86 {882505AD-246D-402A-8414-347EFB8E2C8D}.Debug|Win32.ActiveCfg = Debug|x86 {882505AD-246D-402A-8414-347EFB8E2C8D}.Debug|Win32.Build.0 = Debug|x86 {882505AD-246D-402A-8414-347EFB8E2C8D}.Debug|x64.ActiveCfg = Debug|x64 {882505AD-246D-402A-8414-347EFB8E2C8D}.Debug|x64.Build.0 = Debug|x64 - {882505AD-246D-402A-8414-347EFB8E2C8D}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {882505AD-246D-402A-8414-347EFB8E2C8D}.Release|Mixed Platforms.Build.0 = Release|x86 {882505AD-246D-402A-8414-347EFB8E2C8D}.Release|Win32.ActiveCfg = Release|x86 {882505AD-246D-402A-8414-347EFB8E2C8D}.Release|Win32.Build.0 = Release|x86 {882505AD-246D-402A-8414-347EFB8E2C8D}.Release|x64.ActiveCfg = Release|x64 {882505AD-246D-402A-8414-347EFB8E2C8D}.Release|x64.Build.0 = Release|x64 - {C043FFF7-5F71-4FFC-989A-E09E18548589}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {C043FFF7-5F71-4FFC-989A-E09E18548589}.Debug|Mixed Platforms.Build.0 = Debug|x86 {C043FFF7-5F71-4FFC-989A-E09E18548589}.Debug|Win32.ActiveCfg = Debug|x86 {C043FFF7-5F71-4FFC-989A-E09E18548589}.Debug|Win32.Build.0 = Debug|x86 {C043FFF7-5F71-4FFC-989A-E09E18548589}.Debug|x64.ActiveCfg = Debug|x64 {C043FFF7-5F71-4FFC-989A-E09E18548589}.Debug|x64.Build.0 = Debug|x64 - {C043FFF7-5F71-4FFC-989A-E09E18548589}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {C043FFF7-5F71-4FFC-989A-E09E18548589}.Release|Mixed Platforms.Build.0 = Release|x86 {C043FFF7-5F71-4FFC-989A-E09E18548589}.Release|Win32.ActiveCfg = Release|x86 {C043FFF7-5F71-4FFC-989A-E09E18548589}.Release|Win32.Build.0 = Release|x86 {C043FFF7-5F71-4FFC-989A-E09E18548589}.Release|x64.ActiveCfg = Release|x64 {C043FFF7-5F71-4FFC-989A-E09E18548589}.Release|x64.Build.0 = Release|x64 - {7B495581-2271-4F41-9476-ACB86E8C864F}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {7B495581-2271-4F41-9476-ACB86E8C864F}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {7B495581-2271-4F41-9476-ACB86E8C864F}.Debug|Win32.ActiveCfg = Debug|Win32 {7B495581-2271-4F41-9476-ACB86E8C864F}.Debug|Win32.Build.0 = Debug|Win32 {7B495581-2271-4F41-9476-ACB86E8C864F}.Debug|x64.ActiveCfg = Debug|x64 {7B495581-2271-4F41-9476-ACB86E8C864F}.Debug|x64.Build.0 = Debug|x64 - {7B495581-2271-4F41-9476-ACB86E8C864F}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {7B495581-2271-4F41-9476-ACB86E8C864F}.Release|Mixed Platforms.Build.0 = Release|Win32 {7B495581-2271-4F41-9476-ACB86E8C864F}.Release|Win32.ActiveCfg = Release|Win32 {7B495581-2271-4F41-9476-ACB86E8C864F}.Release|Win32.Build.0 = Release|Win32 {7B495581-2271-4F41-9476-ACB86E8C864F}.Release|x64.ActiveCfg = Release|x64 {7B495581-2271-4F41-9476-ACB86E8C864F}.Release|x64.Build.0 = Release|x64 - {A55848CC-10E7-40CB-ADDB-04740B16DD43}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {A55848CC-10E7-40CB-ADDB-04740B16DD43}.Debug|Mixed Platforms.Build.0 = Debug|x86 {A55848CC-10E7-40CB-ADDB-04740B16DD43}.Debug|Win32.ActiveCfg = Debug|x86 {A55848CC-10E7-40CB-ADDB-04740B16DD43}.Debug|Win32.Build.0 = Debug|x86 {A55848CC-10E7-40CB-ADDB-04740B16DD43}.Debug|x64.ActiveCfg = Debug|x64 {A55848CC-10E7-40CB-ADDB-04740B16DD43}.Debug|x64.Build.0 = Debug|x64 - {A55848CC-10E7-40CB-ADDB-04740B16DD43}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {A55848CC-10E7-40CB-ADDB-04740B16DD43}.Release|Mixed Platforms.Build.0 = Release|x86 {A55848CC-10E7-40CB-ADDB-04740B16DD43}.Release|Win32.ActiveCfg = Release|x86 {A55848CC-10E7-40CB-ADDB-04740B16DD43}.Release|Win32.Build.0 = Release|x86 {A55848CC-10E7-40CB-ADDB-04740B16DD43}.Release|x64.ActiveCfg = Release|x64 {A55848CC-10E7-40CB-ADDB-04740B16DD43}.Release|x64.Build.0 = Release|x64 - {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Debug|Win32.ActiveCfg = Debug|Win32 {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Debug|Win32.Build.0 = Debug|Win32 {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Debug|x64.ActiveCfg = Debug|x64 {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Debug|x64.Build.0 = Debug|x64 - {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Release|Mixed Platforms.Build.0 = Release|Win32 {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Release|Win32.ActiveCfg = Release|Win32 {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Release|Win32.Build.0 = Release|Win32 {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Release|x64.ActiveCfg = Release|x64 {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Release|x64.Build.0 = Release|x64 - {483B158D-F57D-49D9-9046-31E6A73F8A53}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {483B158D-F57D-49D9-9046-31E6A73F8A53}.Debug|Mixed Platforms.Build.0 = Debug|x86 {483B158D-F57D-49D9-9046-31E6A73F8A53}.Debug|Win32.ActiveCfg = Debug|x86 {483B158D-F57D-49D9-9046-31E6A73F8A53}.Debug|Win32.Build.0 = Debug|x86 {483B158D-F57D-49D9-9046-31E6A73F8A53}.Debug|x64.ActiveCfg = Debug|x64 {483B158D-F57D-49D9-9046-31E6A73F8A53}.Debug|x64.Build.0 = Debug|x64 - {483B158D-F57D-49D9-9046-31E6A73F8A53}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {483B158D-F57D-49D9-9046-31E6A73F8A53}.Release|Mixed Platforms.Build.0 = Release|x86 {483B158D-F57D-49D9-9046-31E6A73F8A53}.Release|Win32.ActiveCfg = Release|x86 {483B158D-F57D-49D9-9046-31E6A73F8A53}.Release|Win32.Build.0 = Release|x86 {483B158D-F57D-49D9-9046-31E6A73F8A53}.Release|x64.ActiveCfg = Release|x64 {483B158D-F57D-49D9-9046-31E6A73F8A53}.Release|x64.Build.0 = Release|x64 - {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Debug|Mixed Platforms.Build.0 = Debug|x86 {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Debug|Win32.ActiveCfg = Debug|x86 {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Debug|Win32.Build.0 = Debug|x86 {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Debug|x64.ActiveCfg = Debug|x64 {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Debug|x64.Build.0 = Debug|x64 - {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Release|Mixed Platforms.Build.0 = Release|x86 {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Release|Win32.ActiveCfg = Release|x86 {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Release|Win32.Build.0 = Release|x86 {A4DEB90C-A529-4A93-ACE3-226A39EFCB00}.Release|x64.ActiveCfg = Release|x64 From f73e501470df5dba6f8aa186b2c58d2dace7248b Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 18 Nov 2014 13:15:34 +1000 Subject: [PATCH 14/17] Start of renaming from 'Offscreen' to 'OffScreen' - pedantic I know! lol --- .../CefSharp.Offscreen.Example.csproj | 8 ++++---- CefSharp.Offscreen.Example/Program.cs | 2 +- CefSharp.Offscreen/CefSharp.Offscreen.csproj | 12 ++++++------ CefSharp.Offscreen/ChromiumWebBrowser.cs | 2 +- CefSharp3.sln | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj b/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj index 6ae35c9c9..16bf7a69c 100644 --- a/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj +++ b/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj @@ -7,8 +7,8 @@ {A4DEB90C-A529-4A93-ACE3-226A39EFCB00} Exe Properties - CefSharp.Offscreen.Example - CefSharp.Offscreen.Example + CefSharp.OffScreen.Example + CefSharp.OffScreen.Example v4.0 512 Client @@ -68,9 +68,9 @@ {a4394e7b-1155-43a6-989e-8ab72dddc9e4} CefSharp.Example - + {483b158d-f57d-49d9-9046-31e6a73f8a53} - CefSharp.Offscreen + CefSharp.OffScreen {a55848cc-10e7-40cb-addb-04740b16dd43} diff --git a/CefSharp.Offscreen.Example/Program.cs b/CefSharp.Offscreen.Example/Program.cs index 50aa330d1..cd57525a6 100644 --- a/CefSharp.Offscreen.Example/Program.cs +++ b/CefSharp.Offscreen.Example/Program.cs @@ -7,7 +7,7 @@ using System.Diagnostics; using System.IO; using CefSharp.Example; -namespace CefSharp.Offscreen.Example +namespace CefSharp.OffScreen.Example { public class Program { diff --git a/CefSharp.Offscreen/CefSharp.Offscreen.csproj b/CefSharp.Offscreen/CefSharp.Offscreen.csproj index 4268fe092..9e5eac677 100644 --- a/CefSharp.Offscreen/CefSharp.Offscreen.csproj +++ b/CefSharp.Offscreen/CefSharp.Offscreen.csproj @@ -7,8 +7,8 @@ {483B158D-F57D-49D9-9046-31E6A73F8A53} Library Properties - CefSharp.Offscreen - CefSharp.Offscreen + CefSharp.OffScreen + CefSharp.OffScreen v4.0 512 Client @@ -21,7 +21,7 @@ x64 prompt MinimumRecommendedRules.ruleset - bin\x64\Debug\CefSharp.Offscreen.XML + bin\x64\Debug\CefSharp.OffScreen.xml bin\x64\Release\ @@ -31,7 +31,7 @@ x64 prompt MinimumRecommendedRules.ruleset - bin\x64\Release\CefSharp.Offscreen.XML + bin\x64\Release\CefSharp.OffScreen.xml true @@ -41,7 +41,7 @@ x86 prompt MinimumRecommendedRules.ruleset - bin\x86\Debug\CefSharp.Offscreen.XML + bin\x86\Debug\CefSharp.OffScreen.xml 1591 @@ -52,7 +52,7 @@ x86 prompt MinimumRecommendedRules.ruleset - bin\x86\Release\CefSharp.Offscreen.XML + bin\x86\Release\CefSharp.OffScreen.xml diff --git a/CefSharp.Offscreen/ChromiumWebBrowser.cs b/CefSharp.Offscreen/ChromiumWebBrowser.cs index ff4d124c6..3c938db12 100644 --- a/CefSharp.Offscreen/ChromiumWebBrowser.cs +++ b/CefSharp.Offscreen/ChromiumWebBrowser.cs @@ -13,7 +13,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using CefSharp.Internals; -namespace CefSharp.Offscreen +namespace CefSharp.OffScreen { /// /// An offscreen instance of Chromium that you can use to take diff --git a/CefSharp3.sln b/CefSharp3.sln index 49ec754cc..8e8d8a115 100644 --- a/CefSharp3.sln +++ b/CefSharp3.sln @@ -63,9 +63,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{9AD9C469 build.ps1 = build.ps1 EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.Offscreen", "CefSharp.Offscreen\CefSharp.Offscreen.csproj", "{483B158D-F57D-49D9-9046-31E6A73F8A53}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.OffScreen", "CefSharp.OffScreen\CefSharp.OffScreen.csproj", "{483B158D-F57D-49D9-9046-31E6A73F8A53}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.Offscreen.Example", "CefSharp.Offscreen.Example\CefSharp.Offscreen.Example.csproj", "{A4DEB90C-A529-4A93-ACE3-226A39EFCB00}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.OffScreen.Example", "CefSharp.OffScreen.Example\CefSharp.OffScreen.Example.csproj", "{A4DEB90C-A529-4A93-ACE3-226A39EFCB00}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution From 4ba99d274cfd061343bf121ed61dc0603513d89f Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 18 Nov 2014 13:16:51 +1000 Subject: [PATCH 15/17] Finish renaming --- .../CefSharp.Offscreen.Example.csproj | 0 .../Program.cs | 0 .../Properties/AssemblyInfo.cs | 0 .../app.config | 0 .../packages.config | 0 .../CefSharp.Offscreen.csproj | 0 {CefSharp.Offscreen => CefSharp.OffScreen}/ChromiumWebBrowser.cs | 0 .../Properties/AssemblyInfo.cs | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename {CefSharp.Offscreen.Example => CefSharp.OffScreen.Example}/CefSharp.Offscreen.Example.csproj (100%) rename {CefSharp.Offscreen.Example => CefSharp.OffScreen.Example}/Program.cs (100%) rename {CefSharp.Offscreen.Example => CefSharp.OffScreen.Example}/Properties/AssemblyInfo.cs (100%) rename {CefSharp.Offscreen.Example => CefSharp.OffScreen.Example}/app.config (100%) rename {CefSharp.Offscreen.Example => CefSharp.OffScreen.Example}/packages.config (100%) rename {CefSharp.Offscreen => CefSharp.OffScreen}/CefSharp.Offscreen.csproj (100%) rename {CefSharp.Offscreen => CefSharp.OffScreen}/ChromiumWebBrowser.cs (100%) rename {CefSharp.Offscreen => CefSharp.OffScreen}/Properties/AssemblyInfo.cs (100%) diff --git a/CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj b/CefSharp.OffScreen.Example/CefSharp.Offscreen.Example.csproj similarity index 100% rename from CefSharp.Offscreen.Example/CefSharp.Offscreen.Example.csproj rename to CefSharp.OffScreen.Example/CefSharp.Offscreen.Example.csproj diff --git a/CefSharp.Offscreen.Example/Program.cs b/CefSharp.OffScreen.Example/Program.cs similarity index 100% rename from CefSharp.Offscreen.Example/Program.cs rename to CefSharp.OffScreen.Example/Program.cs diff --git a/CefSharp.Offscreen.Example/Properties/AssemblyInfo.cs b/CefSharp.OffScreen.Example/Properties/AssemblyInfo.cs similarity index 100% rename from CefSharp.Offscreen.Example/Properties/AssemblyInfo.cs rename to CefSharp.OffScreen.Example/Properties/AssemblyInfo.cs diff --git a/CefSharp.Offscreen.Example/app.config b/CefSharp.OffScreen.Example/app.config similarity index 100% rename from CefSharp.Offscreen.Example/app.config rename to CefSharp.OffScreen.Example/app.config diff --git a/CefSharp.Offscreen.Example/packages.config b/CefSharp.OffScreen.Example/packages.config similarity index 100% rename from CefSharp.Offscreen.Example/packages.config rename to CefSharp.OffScreen.Example/packages.config diff --git a/CefSharp.Offscreen/CefSharp.Offscreen.csproj b/CefSharp.OffScreen/CefSharp.Offscreen.csproj similarity index 100% rename from CefSharp.Offscreen/CefSharp.Offscreen.csproj rename to CefSharp.OffScreen/CefSharp.Offscreen.csproj diff --git a/CefSharp.Offscreen/ChromiumWebBrowser.cs b/CefSharp.OffScreen/ChromiumWebBrowser.cs similarity index 100% rename from CefSharp.Offscreen/ChromiumWebBrowser.cs rename to CefSharp.OffScreen/ChromiumWebBrowser.cs diff --git a/CefSharp.Offscreen/Properties/AssemblyInfo.cs b/CefSharp.OffScreen/Properties/AssemblyInfo.cs similarity index 100% rename from CefSharp.Offscreen/Properties/AssemblyInfo.cs rename to CefSharp.OffScreen/Properties/AssemblyInfo.cs From f3f9fd2ed132e088636879a9a9274da69f2543e7 Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 18 Nov 2014 13:31:01 +1000 Subject: [PATCH 16/17] Rename `Offscreen` in AssemblyInfo --- CefSharp.OffScreen.Example/Properties/AssemblyInfo.cs | 2 +- CefSharp.OffScreen/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CefSharp.OffScreen.Example/Properties/AssemblyInfo.cs b/CefSharp.OffScreen.Example/Properties/AssemblyInfo.cs index 26d041a75..efee26097 100644 --- a/CefSharp.OffScreen.Example/Properties/AssemblyInfo.cs +++ b/CefSharp.OffScreen.Example/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System; using System.Reflection; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("CefSharp.Offscreen.Example")] +[assembly: AssemblyTitle("CefSharp.OffScreen.Example")] [assembly: AssemblyCompany(AssemblyInfo.AssemblyCompany)] [assembly: AssemblyProduct(AssemblyInfo.AssemblyProduct)] [assembly: AssemblyCopyright(AssemblyInfo.AssemblyCopyright)] diff --git a/CefSharp.OffScreen/Properties/AssemblyInfo.cs b/CefSharp.OffScreen/Properties/AssemblyInfo.cs index 48890c443..b393392dd 100644 --- a/CefSharp.OffScreen/Properties/AssemblyInfo.cs +++ b/CefSharp.OffScreen/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System; using System.Reflection; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("CefSharp.Offscreen")] +[assembly: AssemblyTitle("CefSharp.OffScreen")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyTrademark("")] From eded63be55e4aa98e87125f5367b02d29b54ab75 Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 18 Nov 2014 13:32:38 +1000 Subject: [PATCH 17/17] Hopefully the final renaming --- ...Offscreen.Example.csproj => CefSharp.OffScreen.Example.csproj} | 0 .../{CefSharp.Offscreen.csproj => CefSharp.OffScreen.csproj} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename CefSharp.OffScreen.Example/{CefSharp.Offscreen.Example.csproj => CefSharp.OffScreen.Example.csproj} (100%) rename CefSharp.OffScreen/{CefSharp.Offscreen.csproj => CefSharp.OffScreen.csproj} (100%) diff --git a/CefSharp.OffScreen.Example/CefSharp.Offscreen.Example.csproj b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj similarity index 100% rename from CefSharp.OffScreen.Example/CefSharp.Offscreen.Example.csproj rename to CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj diff --git a/CefSharp.OffScreen/CefSharp.Offscreen.csproj b/CefSharp.OffScreen/CefSharp.OffScreen.csproj similarity index 100% rename from CefSharp.OffScreen/CefSharp.Offscreen.csproj rename to CefSharp.OffScreen/CefSharp.OffScreen.csproj