Hybrid Bridge
Classes | Public Member Functions | Protected Member Functions | Properties | List of all members
HybridBridge.Win81.WebViewHybridBridge Class Reference

WebViewHybridBridge is a class containing a list of registered IBridgeHandler instances for Windows WebView object. More...

Inheritance diagram for HybridBridge.Win81.WebViewHybridBridge:
HybridBridge.BridgeController

Classes

class  UriToHybridResolver
 IUriToStreamResolver compatible class responsible for handling hybrid requests More...
 

Public Member Functions

 WebViewHybridBridge (WebView webView, string customProtocol, IEnumerable< IBridgeHandler > collection)
 Creates a new instance of this class for the provided WebView with the provided string as the custom url protocol and passed collection of IBridgeHandler instances More...
 
 WebViewHybridBridge (WebView webView, string customProtocol)
 Creates a new instance of this class for the provided WebView with the provided string as the custom url protocol More...
 
 WebViewHybridBridge (WebView webView, IEnumerable< IBridgeHandler > collection)
 Creates a new instance of this class for the provided WebView with passed collection of IBridgeHandler instances More...
 
 WebViewHybridBridge (WebView webView)
 Creates a new instance of this class for the provided WebView More...
 
override void ExecuteJavascript (string jsCode, Action< object > result)
 Executes a Javascript string and calls the passed callback for result More...
 
- Public Member Functions inherited from HybridBridge.BridgeController
virtual IEnumerator< IBridgeHandlerGetEnumerator ()
 Returns the IEnumerator object for this class More...
 
void Add (IBridgeHandler item)
 Adds a new IBridgeHandler object to the list More...
 
void Clear ()
 Clears the list by removing all registered IBridgeHandler objects More...
 
virtual bool Contains (IBridgeHandler item)
 Goes through the list of registered IBridgeHandler objects and checks for existing of the passed instance More...
 
virtual void CopyTo (IBridgeHandler[] array, int arrayIndex)
 Copies the list of registered IBridgeHandler object to an array More...
 
bool Remove (IBridgeHandler item)
 Removes the passed instance of IBridgeHandler from the list of the registered handlers More...
 
virtual int IndexOf (IBridgeHandler item)
 Returns the index of the passed IBridgeHandler instance in the list More...
 
virtual void Insert (int index, IBridgeHandler item)
 Inserts and registers the passed instance of IBridgeHandler More...
 
virtual void RemoveAt (int index)
 Removed a IBridgeHandler instance at the specific index More...
 
virtual T Get< T > ()
 Returns a registered IBridgeHandler by type More...
 
virtual IBridgeHandler Get (Type type)
 Returns a registered IBridgeHandler by type More...
 
virtual object ExecuteJavascript (string jsCode)
 Executes a Javascript string and returns the result More...
 
virtual void FireJavascript (string jsCode)
 Fires a Javascript string More...
 
virtual object CallJavascriptFunction (string methodName, params object[] arguments)
 Calls a Javascript method with the provided arguments and return the result More...
 
virtual void CallJavascriptAction (string methodName, params object[] arguments)
 Calls a Javascript method with the provided arguments and return the result More...
 
void AddRange (IEnumerable< IBridgeHandler > collection)
 Adds a list of IBridgeHandler instances to the list More...
 

Protected Member Functions

override string NormalizeCustomProtocol (string customProtocol=null)
 Makes sure that the passed custom protocol is acceptable and makes the necessarily changes More...
 
virtual void WebViewOnDomContentLoaded (WebView sender, WebViewDOMContentLoadedEventArgs args)
 Gets called when the monitoring WebView loads an HTML file and More...
 
- Protected Member Functions inherited from HybridBridge.BridgeController
 BridgeController (string customProtocol, IEnumerable< IBridgeHandler > collection)
 Creates a new instance of BridgeController class More...
 
 BridgeController (string customProtocol)
 Creates a new instance of BridgeController class More...
 
 BridgeController (IEnumerable< IBridgeHandler > collection)
 Creates a new instance of BridgeController class More...
 
 BridgeController ()
 Creates a new instance of BridgeController class More...
 
virtual void Initialize ()
 Executes the BridgeController javascript code More...
 
virtual bool HandleRequestUrl (string url)
 Handles a request and leaves the result behind More...
 
virtual bool HandleRequestUrl (string url, out bool hasResult, out object result)
 Handles a request More...
 
virtual void PushJavascript ()
 Generated the Javascript code for the BridgeController class as well as all the registered handlers More...
 
virtual object BridgeHandler_PushJavascript (IBridgeHandler sender, PushJavascriptEventArgs eventArgs)
 Passes Javascript requests from the IBridgeHandler instances to the browser More...
 

Properties

IUriToStreamResolver BridgeResolver [get, protected set]
 Gets the IUriToStreamResolver responsible for processing hybrid requests More...
 
WebView WebView [get]
 The WebView to handle requests from More...
 
IUriToStreamResolver CustomUriToStreamResolver [get, set]
 Gets or sets the IUriToStreamResolver to be used as a custom resolver of requesting Url(s) More...
 
- Properties inherited from HybridBridge.BridgeController
virtual TimeSpan JavascriptTimeout [get, set]
 Sets or gets the time that we should wait for the result of any Javascript invocation, this value doesn't applies to callbacks More...
 
string Protocol = TimeSpan.FromSeconds(3) [get, protected set]
 The protocol to use for communication with web browser More...
 
virtual IBridgeHandler this[int index] [get, set]
 Set or get an IBridgeHandler instance by index More...
 

Additional Inherited Members

- Public Attributes inherited from HybridBridge.BridgeController
virtual int Count => Handlers.Count
 Returns the number of registered IBridgeHandler objects More...
 
virtual bool IsReadOnly => false
 Indicates if the list is read only More...
 
- Protected Attributes inherited from HybridBridge.BridgeController
readonly List< IBridgeHandlerHandlers = new List<IBridgeHandler>()
 The underlying list of IBridgeHandler instances More...
 

Detailed Description

WebViewHybridBridge is a class containing a list of registered IBridgeHandler instances for Windows WebView object.

Definition at line 20 of file WebViewHybridBridge.cs.

Constructor & Destructor Documentation

HybridBridge.Win81.WebViewHybridBridge.WebViewHybridBridge ( WebView  webView,
string  customProtocol,
IEnumerable< IBridgeHandler collection 
)

Creates a new instance of this class for the provided WebView with the provided string as the custom url protocol and passed collection of IBridgeHandler instances

Parameters
webViewThe WebView to handle requests from
customProtocolThe protocol to use for communication with web browser, or to use defualt
collectionThe collection of IBridgeHandler instances to add to this list

Definition at line 33 of file WebViewHybridBridge.cs.

HybridBridge.Win81.WebViewHybridBridge.WebViewHybridBridge ( WebView  webView,
string  customProtocol 
)

Creates a new instance of this class for the provided WebView with the provided string as the custom url protocol

Parameters
webViewThe WebView to handle requests from
customProtocolThe protocol to use for communication with web browser, or to use defualt

Definition at line 51 of file WebViewHybridBridge.cs.

HybridBridge.Win81.WebViewHybridBridge.WebViewHybridBridge ( WebView  webView,
IEnumerable< IBridgeHandler collection 
)

Creates a new instance of this class for the provided WebView with passed collection of IBridgeHandler instances

Parameters
webViewThe WebView to handle requests from
collectionThe collection of IBridgeHandler instances to add to this list

Definition at line 62 of file WebViewHybridBridge.cs.

HybridBridge.Win81.WebViewHybridBridge.WebViewHybridBridge ( WebView  webView)

Creates a new instance of this class for the provided WebView

Parameters
webViewThe WebView to handle requests from

Definition at line 71 of file WebViewHybridBridge.cs.

Member Function Documentation

override void HybridBridge.Win81.WebViewHybridBridge.ExecuteJavascript ( string  jsCode,
Action< object >  result 
)
virtual

Executes a Javascript string and calls the passed callback for result

Parameters
jsCodeThe code to execute
resultThe callback to be called with the result of the execution

Reimplemented from HybridBridge.BridgeController.

Definition at line 148 of file WebViewHybridBridge.cs.

override string HybridBridge.Win81.WebViewHybridBridge.NormalizeCustomProtocol ( string  customProtocol = null)
protectedvirtual

Makes sure that the passed custom protocol is acceptable and makes the necessarily changes

Reimplemented from HybridBridge.BridgeController.

Definition at line 94 of file WebViewHybridBridge.cs.

virtual void HybridBridge.Win81.WebViewHybridBridge.WebViewOnDomContentLoaded ( WebView  sender,
WebViewDOMContentLoadedEventArgs  args 
)
protectedvirtual

Gets called when the monitoring WebView loads an HTML file and

Parameters
senderThe WebView calling this method
argsThe event arguments
Exceptions
NotSupportedExceptionFollowing protocol is not supported for Hybrid requests

Definition at line 106 of file WebViewHybridBridge.cs.

Property Documentation

IUriToStreamResolver HybridBridge.Win81.WebViewHybridBridge.BridgeResolver
getprotected set

Gets the IUriToStreamResolver responsible for processing hybrid requests

Definition at line 78 of file WebViewHybridBridge.cs.

IUriToStreamResolver HybridBridge.Win81.WebViewHybridBridge.CustomUriToStreamResolver
getset

Gets or sets the IUriToStreamResolver to be used as a custom resolver of requesting Url(s)

Definition at line 88 of file WebViewHybridBridge.cs.

WebView HybridBridge.Win81.WebViewHybridBridge.WebView
get

The WebView to handle requests from

Definition at line 83 of file WebViewHybridBridge.cs.


The documentation for this class was generated from the following file: