|
Hybrid Bridge
|
WebViewHybridServer is a class containing a list of registered IBridgeHandler instances for Windows WebView object managing a local http server for two way commication with the WebView object. More...
Public Member Functions | |
| WebViewHybridServer (WebView webView, IEnumerable< IBridgeHandler > collection) | |
| Creates a new instance of this class for the provided WebView with passed collection of IBridgeHandler instances More... | |
| WebViewHybridServer (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.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< IBridgeHandler > | GetEnumerator () |
| 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 async void | WebViewOnDomContentLoaded (WebView sender, WebViewDOMContentLoadedEventArgs args) |
| Gets called when the monitoring WebView loads an HTML file and 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 | |
| WebView | WebView [get] |
| The WebView 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< IBridgeHandler > | Handlers = new List<IBridgeHandler>() |
| The underlying list of IBridgeHandler instances More... | |
WebViewHybridServer is a class containing a list of registered IBridgeHandler instances for Windows WebView object managing a local http server for two way commication with the WebView object.
Definition at line 17 of file WebViewHybridServer.cs.
| HybridBridge.Win81.WebViewHybridServer.WebViewHybridServer | ( | WebView | webView, |
| IEnumerable< IBridgeHandler > | collection | ||
| ) |
Creates a new instance of this class for the provided WebView with passed collection of IBridgeHandler instances
| webView | The WebView to handle requests from |
| collection | The collection of IBridgeHandler instances to add to this list |
Definition at line 25 of file WebViewHybridServer.cs.
| HybridBridge.Win81.WebViewHybridServer.WebViewHybridServer | ( | WebView | webView | ) |
Creates a new instance of this class for the provided WebView
| webView | The WebView to handle requests from |
Definition at line 37 of file WebViewHybridServer.cs.
|
virtual |
Executes a Javascript string and calls the passed callback for result
| jsCode | The code to execute |
| result | The callback to be called with the result of the execution |
Reimplemented from HybridBridge.BridgeController.
Definition at line 64 of file WebViewHybridServer.cs.
|
protectedvirtual |
Gets called when the monitoring WebView loads an HTML file and
| sender | The WebView calling this method |
| args | The event arguments |
| NotSupportedException | Following protocol is not supported for Hybrid requests |
Definition at line 52 of file WebViewHybridServer.cs.
|
get |
The WebView to handle requests from
Definition at line 44 of file WebViewHybridServer.cs.
1.8.11