Hybrid Bridge
Public Member Functions | Protected Member Functions | Properties | List of all members
HybridBridge.Win.WebBrowserHybridServer Class Reference

WebBrowserHybridServer is a class containing a list of registered IBridgeHandler instances for WinForm WebBrowser control. More...

Inheritance diagram for HybridBridge.Win.WebBrowserHybridServer:
HybridBridge.WebServer.HybridBridgeLocalServer HybridBridge.BridgeController

Public Member Functions

 WebBrowserHybridServer (WebBrowser webView, IEnumerable< IBridgeHandler > collection)
 Creates a new instance of this class for the provided WebBrowser and with the passed collection of IBridgeHandlers More...
 
 WebBrowserHybridServer (WebBrowser webView)
 Creates a new instance of this class for the provided WebBrowser 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.WebServer.HybridBridgeLocalServer
virtual void Dispose ()
 The method to dispose this class More...
 
virtual async Task RunServerAsync ()
 Starts the local HTTP server and listen for requests 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

virtual void InvokeOnUiThread (Action action)
 Invokes a piece of code on the WebView thread More...
 
- Protected Member Functions inherited from HybridBridge.WebServer.HybridBridgeLocalServer
 HybridBridgeLocalServer (IEnumerable< IBridgeHandler > collection)
 Creates a new instance of this class for passed collection of IBridgeHandler instances More...
 
 HybridBridgeLocalServer ()
 Creates a new instance of this class More...
 
override string NormalizeCustomProtocol (string customProtocol=null)
 Makes sure that the passed custom protocol is acceptable and makes the necessarily changes More...
 
virtual async void OnHttpRequest (IHttpRequest httpRequest)
 Analyzes and responses to new HTTP requests received by the server More...
 
virtual void Dispose (bool disposing)
 The method to dispose this class 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

WebBrowser WebView [get]
 The WebBrowser to handle requests from More...
 
- Properties inherited from HybridBridge.WebServer.HybridBridgeLocalServer
virtual HttpListener Server [get, protected set]
 Underlying HttpListener instance More...
 
virtual ushort PortNumber [get]
 The port number that the server listens to 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.WebServer.HybridBridgeLocalServer
bool Disposed
 Indicates if the object already disposed More...
 
- Protected Attributes inherited from HybridBridge.BridgeController
readonly List< IBridgeHandlerHandlers = new List<IBridgeHandler>()
 The underlying list of IBridgeHandler instances More...
 

Detailed Description

WebBrowserHybridServer is a class containing a list of registered IBridgeHandler instances for WinForm WebBrowser control.

Definition at line 14 of file WebBrowserHybridServer.cs.

Constructor & Destructor Documentation

HybridBridge.Win.WebBrowserHybridServer.WebBrowserHybridServer ( WebBrowser  webView,
IEnumerable< IBridgeHandler collection 
)

Creates a new instance of this class for the provided WebBrowser and with the passed collection of IBridgeHandlers

Parameters
webViewThe WebBrowser to handle requests from
collectionA collection of IBridgeHandler objects

Definition at line 22 of file WebBrowserHybridServer.cs.

HybridBridge.Win.WebBrowserHybridServer.WebBrowserHybridServer ( WebBrowser  webView)

Creates a new instance of this class for the provided WebBrowser

Parameters
webViewThe WebBrowser to handle requests from

Definition at line 33 of file WebBrowserHybridServer.cs.

Member Function Documentation

override void HybridBridge.Win.WebBrowserHybridServer.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 53 of file WebBrowserHybridServer.cs.

virtual void HybridBridge.Win.WebBrowserHybridServer.InvokeOnUiThread ( Action  action)
protectedvirtual

Invokes a piece of code on the WebView thread

Parameters
actionThe code to execute

Definition at line 76 of file WebBrowserHybridServer.cs.

Property Documentation

WebBrowser HybridBridge.Win.WebBrowserHybridServer.WebView
get

The WebBrowser to handle requests from

Definition at line 40 of file WebBrowserHybridServer.cs.


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