From c226d344b1541796bd1093f6c1cefd0626ad755b Mon Sep 17 00:00:00 2001 From: Alex Maitland Date: Fri, 8 Oct 2021 10:21:31 +1000 Subject: [PATCH] WinForms/WPF/OffScreen - Add LoadUrl method (Same as Load(string)). A more meaningful name for the method, matches the LoadUrlAsync method that was added recently. --- CefSharp.OffScreen/ChromiumWebBrowser.cs | 5 +---- CefSharp.WinForms/ChromiumWebBrowser.cs | 5 +---- CefSharp.Wpf/ChromiumWebBrowser.cs | 5 +---- CefSharp/IWebBrowser.cs | 15 ++++++++++++++- .../Partial/ChromiumWebBrowser.Partial.cs | 6 ++++++ 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/CefSharp.OffScreen/ChromiumWebBrowser.cs b/CefSharp.OffScreen/ChromiumWebBrowser.cs index 705fbf456a..f5edd04c4b 100644 --- a/CefSharp.OffScreen/ChromiumWebBrowser.cs +++ b/CefSharp.OffScreen/ChromiumWebBrowser.cs @@ -510,10 +510,7 @@ public Task ScreenshotAsync(bool ignoreExistingScreenshot = false, Popup return completionSource.Task; } - /// - /// Loads the specified URL. - /// - /// The URL to be loaded. + /// public void Load(string url) { Address = url; diff --git a/CefSharp.WinForms/ChromiumWebBrowser.cs b/CefSharp.WinForms/ChromiumWebBrowser.cs index 65c02006e9..3b9b8fe787 100644 --- a/CefSharp.WinForms/ChromiumWebBrowser.cs +++ b/CefSharp.WinForms/ChromiumWebBrowser.cs @@ -446,10 +446,7 @@ private void InternalDispose(bool disposing) Cef.RemoveDisposable(this); } - /// - /// Loads the specified URL. - /// - /// The URL to be loaded. + /// public void Load(string url) { if (IsBrowserInitialized) diff --git a/CefSharp.Wpf/ChromiumWebBrowser.cs b/CefSharp.Wpf/ChromiumWebBrowser.cs index b19984ea85..f7259ab501 100644 --- a/CefSharp.Wpf/ChromiumWebBrowser.cs +++ b/CefSharp.Wpf/ChromiumWebBrowser.cs @@ -2414,10 +2414,7 @@ protected override AutomationPeer OnCreateAutomationPeer() } - /// - /// Loads the specified URL. - /// - /// The URL to be loaded. + /// public void Load(string url) { if (!InternalIsBrowserInitialized()) diff --git a/CefSharp/IWebBrowser.cs b/CefSharp/IWebBrowser.cs index eb5866a91f..77d7d67bd6 100644 --- a/CefSharp/IWebBrowser.cs +++ b/CefSharp/IWebBrowser.cs @@ -81,11 +81,24 @@ public interface IWebBrowser : IDisposable event EventHandler JavascriptMessageReceived; /// - /// Loads the specified in the Main Frame + /// Loads the specified in the Main Frame. + /// Same as calling /// /// The URL to be loaded. void Load(string url); + /// + /// Loads the specified in the Main Frame. + /// Same as calling + /// + /// The URL to be loaded. + /// + /// This is exactly the same as calling Load(string), it was added + /// as the method name is more meaningful and easier to discover + /// via Intellisense. + /// + void LoadUrl(string url); + /// /// Load the in the main frame of the browser /// diff --git a/CefSharp/Internals/Partial/ChromiumWebBrowser.Partial.cs b/CefSharp/Internals/Partial/ChromiumWebBrowser.Partial.cs index 100a3686be..0bd3692738 100644 --- a/CefSharp/Internals/Partial/ChromiumWebBrowser.Partial.cs +++ b/CefSharp/Internals/Partial/ChromiumWebBrowser.Partial.cs @@ -320,6 +320,12 @@ void IWebBrowserInternal.OnAfterBrowserCreated(IBrowser browser) OnAfterBrowserCreated(browser); } + /// + public void LoadUrl(string url) + { + Load(url); + } + /// public Task LoadUrlAsync(string url = null, SynchronizationContext ctx = null) {