Hybrid Bridge
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | Properties | Events | List of all members
HybridBridge.EnumBridge< T > Class Template Reference

A generic handler to be used to make C# enumerable types accessible from the Javascript side More...

Inheritance diagram for HybridBridge.EnumBridge< T >:
HybridBridge.IBridgeHandler

Public Member Functions

 EnumBridge ()
 Creates a new instance of this class More...
 
virtual object InterceptRequest (string method, Dictionary< string, object > parameters, out bool hasResult)
 Handles the passed request and returns the result More...
 
virtual bool ShouldInterceptRequest (string handler, string method)
 Checks the request and returns true if this request can be handled by this handler More...
 
virtual void Initialize (BridgeController bridge)
 Initialize the handler and generates the needed Javascript code More...
 

Static Public Member Functions

static IBridgeHandler FromType (Type genericType)
 Creates a new instance of EnumBridge class with the specified Type as the class's generic type More...
 

Protected Member Functions

virtual object OnPushJavascript (PushJavascriptEventArgs eventArgs)
 Raises the PushJavascript event using provided arguments More...
 

Static Protected Attributes

static List< FieldInfo > Fields
 A cached list of enumerable fields for this type More...
 
static readonly object Lock = new object()
 A static object to be used as thread lock when working with other static fields More...
 
static Dictionary< MethodInfo, ParameterInfo[]> Methods
 A cached list of public and non generic methods for this type More...
 

Properties

static string Identification [get]
 Returns a string containing the name of the proxy enumerable object accessible from the Javascript side More...
 
static Type GenericType = typeof(T).FullName.Replace('+', '.') [get]
 Returns the generic type used to create this class More...
 

Events

PushJavascriptEvent PushJavascript
 Event that gets raised when handler needs to push some Javascript code More...
 
- Events inherited from HybridBridge.IBridgeHandler
PushJavascriptEvent PushJavascript
 Event that gets raised when handler needs to push some Javascript code More...
 

Detailed Description

A generic handler to be used to make C# enumerable types accessible from the Javascript side

Contains static, reusable and non generic methods for the EnumBridge class

Template Parameters
TThe enumerable type to be reflected on the Javascript side
Type Constraints
T :struct 
T :IConvertible 

Definition at line 18 of file EnumBridge'1.cs.

Constructor & Destructor Documentation

Creates a new instance of this class

Exceptions
InvalidGenericTypeExceptionIndicates that the passed generic type is not a enumerable

Definition at line 42 of file EnumBridge'1.cs.

Member Function Documentation

static IBridgeHandler HybridBridge.EnumBridge< T >.FromType ( Type  genericType)
static

Creates a new instance of EnumBridge class with the specified Type as the class's generic type

Parameters
genericTypeThe type to create a EnumBridge instance for
Returns
Newly created EnumBridge instance

Definition at line 17 of file EnumBridge.cs.

virtual void HybridBridge.EnumBridge< T >.Initialize ( BridgeController  bridge)
virtual

Initialize the handler and generates the needed Javascript code

Parameters
bridgeThe BridgeController object requesting initialization

Implements HybridBridge.IBridgeHandler.

Definition at line 132 of file EnumBridge'1.cs.

virtual object HybridBridge.EnumBridge< T >.InterceptRequest ( string  method,
Dictionary< string, object >  parameters,
out bool  hasResult 
)
virtual

Handles the passed request and returns the result

Parameters
methodThe method name to handle
parametersThe method parameters
hasResultA boolean value indicting if the handling process resulted in a value
Returns
Returns the value that created from the handling of the request

Implements HybridBridge.IBridgeHandler.

Definition at line 82 of file EnumBridge'1.cs.

virtual object HybridBridge.EnumBridge< T >.OnPushJavascript ( PushJavascriptEventArgs  eventArgs)
protectedvirtual

Raises the PushJavascript event using provided arguments

Parameters
eventArgsThe arguments to be used to raise PushJavascript event
Returns
Returns the result of raising PushJavascript event

Definition at line 162 of file EnumBridge'1.cs.

virtual bool HybridBridge.EnumBridge< T >.ShouldInterceptRequest ( string  handler,
string  method 
)
virtual

Checks the request and returns true if this request can be handled by this handler

Parameters
handlerThe name of requested handler
methodThe method name to handle
Returns
true, if this handler can handle this request, false otherwise

Implements HybridBridge.IBridgeHandler.

Definition at line 118 of file EnumBridge'1.cs.

Member Data Documentation

List<FieldInfo> HybridBridge.EnumBridge< T >.Fields
staticprotected

A cached list of enumerable fields for this type

Definition at line 24 of file EnumBridge'1.cs.

readonly object HybridBridge.EnumBridge< T >.Lock = new object()
staticprotected

A static object to be used as thread lock when working with other static fields

Definition at line 30 of file EnumBridge'1.cs.

Dictionary<MethodInfo, ParameterInfo[]> HybridBridge.EnumBridge< T >.Methods
staticprotected

A cached list of public and non generic methods for this type

Definition at line 36 of file EnumBridge'1.cs.

Property Documentation

Type HybridBridge.EnumBridge< T >.GenericType = typeof(T).FullName.Replace('+', '.')
staticget

Returns the generic type used to create this class

Definition at line 73 of file EnumBridge'1.cs.

string HybridBridge.EnumBridge< T >.Identification
staticget

Returns a string containing the name of the proxy enumerable object accessible from the Javascript side

Definition at line 68 of file EnumBridge'1.cs.

Event Documentation

Event that gets raised when handler needs to push some Javascript code

Definition at line 126 of file EnumBridge'1.cs.


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