diff --git a/CefSharp.Core/Internals/CefFrameWrapper.cpp b/CefSharp.Core/Internals/CefFrameWrapper.cpp index 55345a738..d63ac3b38 100644 --- a/CefSharp.Core/Internals/CefFrameWrapper.cpp +++ b/CefSharp.Core/Internals/CefFrameWrapper.cpp @@ -11,7 +11,7 @@ // True if this object is currently attached to a valid frame. /// /*--cef()--*/ -bool CefFrameWrapper::IsValid() +bool CefFrameWrapper::IsValid::get() { return _frame->IsValid(); } @@ -171,7 +171,7 @@ Task^ CefFrameWrapper::EvaluateScriptAsync(String^ script, // Returns true if this is the main (top-level) frame. /// /*--cef()--*/ -bool CefFrameWrapper::IsMain() +bool CefFrameWrapper::IsMain::get() { return _frame->IsMain(); } @@ -180,7 +180,7 @@ bool CefFrameWrapper::IsMain() // Returns true if this is the focused frame. /// /*--cef()--*/ -bool CefFrameWrapper::IsFocused() +bool CefFrameWrapper::IsFocused::get() { return _frame->IsFocused(); } @@ -193,7 +193,7 @@ bool CefFrameWrapper::IsFocused() // value. /// /*--cef()--*/ -String^ CefFrameWrapper::GetName() +String^ CefFrameWrapper::Name::get() { return StringUtils::ToClr(_frame->GetName()); } @@ -202,7 +202,7 @@ String^ CefFrameWrapper::GetName() // Returns the globally unique identifier for this frame. /// /*--cef()--*/ -Int64 CefFrameWrapper::GetIdentifier() +Int64 CefFrameWrapper::Identifier::get() { return _frame->GetIdentifier(); } @@ -212,7 +212,7 @@ Int64 CefFrameWrapper::GetIdentifier() // frame. /// /*--cef()--*/ -IFrame^ CefFrameWrapper::GetParent() +IFrame^ CefFrameWrapper::Parent::get() { auto parent = _frame->GetParent(); if (parent != nullptr) @@ -226,7 +226,7 @@ IFrame^ CefFrameWrapper::GetParent() // Returns the URL currently loaded in this frame. /// /*--cef()--*/ -String^ CefFrameWrapper::GetUrl() +String^ CefFrameWrapper::Url::get() { return StringUtils::ToClr(_frame->GetURL()); } @@ -235,7 +235,7 @@ String^ CefFrameWrapper::GetUrl() // Returns the browser that this frame belongs to. /// /*--cef()--*/ -IBrowser^ CefFrameWrapper::GetBrowser() +IBrowser^ CefFrameWrapper::Browser::get() { return dynamic_cast(gcnew CefSharpBrowserWrapper(_frame->GetBrowser(), _browserAdapter)); } diff --git a/CefSharp.Core/Internals/CefFrameWrapper.h b/CefSharp.Core/Internals/CefFrameWrapper.h index 05d123347..07f60d0de 100644 --- a/CefSharp.Core/Internals/CefFrameWrapper.h +++ b/CefSharp.Core/Internals/CefFrameWrapper.h @@ -37,7 +37,10 @@ namespace CefSharp // True if this object is currently attached to a valid frame. /// /*--cef()--*/ - virtual bool IsValid(); + virtual property bool IsValid + { + bool get(); + } /// // Execute undo in this frame. @@ -145,13 +148,19 @@ namespace CefSharp // Returns true if this is the main (top-level) frame. /// /*--cef()--*/ - virtual bool IsMain(); + virtual property bool IsMain + { + bool get(); + } /// // Returns true if this is the focused frame. /// /*--cef()--*/ - virtual bool IsFocused(); + virtual property bool IsFocused + { + bool get(); + } /// // Returns the name for this frame. If the frame has an assigned name (for @@ -161,34 +170,48 @@ namespace CefSharp // value. /// /*--cef()--*/ - virtual String^ GetName(); + virtual property String^ Name + { + String^ get(); + } /// // Returns the globally unique identifier for this frame. /// /*--cef()--*/ - virtual System::Int64 GetIdentifier(); + virtual property Int64 Identifier + { + Int64 get(); + } /// // Returns the parent of this frame or NULL if this is the main (top-level) // frame. /// /*--cef()--*/ - virtual IFrame^ GetParent() = IFrame::GetParent; + virtual property IFrame^ Parent + { + IFrame^ get(); + } + // = IFrame::GetParent; /// // Returns the URL currently loaded in this frame. /// /*--cef()--*/ - virtual String^ GetUrl(); + virtual property String^ Url + { + String^ get(); + } - // NOTE: Don't expose this yet, because it - // would be a HUGE breaking change. /// // Returns the browser that this frame belongs to. /// /*--cef()--*/ - virtual IBrowser^ GetBrowser(); + virtual property IBrowser^ Browser + { + IBrowser^ get(); + } /// // Get the V8 context associated with the frame. This method can only be diff --git a/CefSharp/FrameLoadEndEventArgs.cs b/CefSharp/FrameLoadEndEventArgs.cs index 7432037bf..43585e42c 100644 --- a/CefSharp/FrameLoadEndEventArgs.cs +++ b/CefSharp/FrameLoadEndEventArgs.cs @@ -14,7 +14,7 @@ namespace CefSharp public FrameLoadEndEventArgs(IFrame frame, int httpStatusCode) { Frame = frame; - Url = frame.GetUrl(); + Url = frame.Url; HttpStatusCode = httpStatusCode; } diff --git a/CefSharp/FrameLoadStartEventArgs.cs b/CefSharp/FrameLoadStartEventArgs.cs index 221d778b5..defb6c7c2 100644 --- a/CefSharp/FrameLoadStartEventArgs.cs +++ b/CefSharp/FrameLoadStartEventArgs.cs @@ -14,8 +14,8 @@ namespace CefSharp public FrameLoadStartEventArgs(IFrame frame) { Frame = frame; - Url = frame.GetUrl(); - IsMainFrame = frame.IsMain(); + Url = frame.Url; + IsMainFrame = frame.IsMain; } /// diff --git a/CefSharp/IFrame.cs b/CefSharp/IFrame.cs index 59b581ba4..83e2dbda5 100644 --- a/CefSharp/IFrame.cs +++ b/CefSharp/IFrame.cs @@ -15,7 +15,7 @@ namespace CefSharp /// public interface IFrame { - bool IsValid(); + bool IsValid { get; } /// // Execute undo in this frame. @@ -120,13 +120,14 @@ namespace CefSharp // Returns true if this is the main (top-level) frame. /// /*--cef()--*/ - bool IsMain(); + bool IsMain { get; } /// // Returns true if this is the focused frame. /// /*--cef()--*/ - bool IsFocused(); + bool IsFocused { get; } + /// // Returns the name for this frame. If the frame has an assigned name (for @@ -136,31 +137,31 @@ namespace CefSharp // value. /// /*--cef()--*/ - string GetName(); + string Name { get; } /// // Returns the globally unique identifier for this frame. /// /*--cef()--*/ - Int64 GetIdentifier(); + Int64 Identifier { get; } /// // Returns the parent of this frame or NULL if this is the main (top-level) // frame. /// /*--cef()--*/ - IFrame GetParent(); + IFrame Parent { get; } /// // Returns the URL currently loaded in this frame. /// /*--cef()--*/ - string GetUrl(); + string Url { get; } /// // Returns the browser that this frame belongs to. /// /*--cef()--*/ - //IBrowser GetBrowser(); + IBrowser Browser { get; } } } diff --git a/CefSharp/LoadErrorEventArgs.cs b/CefSharp/LoadErrorEventArgs.cs index bdd88f598..275dc19b2 100644 --- a/CefSharp/LoadErrorEventArgs.cs +++ b/CefSharp/LoadErrorEventArgs.cs @@ -14,7 +14,7 @@ namespace CefSharp public LoadErrorEventArgs(IFrame frame, CefErrorCode errorCode, string errorText) { Frame = frame; - FailedUrl = frame.GetUrl(); + FailedUrl = frame.Url; ErrorCode = errorCode; ErrorText = errorText; }