예제 #1
0
 private static void HandleEvent(InteropCall <IApplicationComponent, InteropEvent, bool> call, ElementId elementId, Event e, InteropEvent eventArg = null)
 {
     if (Call(call, elementId, eventArg))
     {
         e.PreventDefault();
     }
 }
예제 #2
0
 public static TResult Invoke <TResult>(InteropCall <IBrowserComponent, None, TResult> kind, ElementId elementId)
 {
     return(JsRuntime.Invoke <TResult>(HandleMessageMethodFullName, new Message <None>()
     {
         CallId = kind.CallId,
         ElementId = elementId,
     }));
 }
예제 #3
0
 public static void SendMessage(InteropCall <IBrowserComponent, None> call, ElementId elementId)
 {
     JsRuntime.Invoke <object>(HandleMessageMethodFullName, new Message <None>()
     {
         CallId    = call.CallId,
         ElementId = elementId,
     });
 }
예제 #4
0
 public static TResult Invoke <TArg, TResult>(InteropCall <IBrowserComponent, TArg, TResult> kind, ElementId elementId, TArg arg)
 {
     return(JsRuntime.Invoke <TResult>(HandleMessageMethodFullName, new Message <TArg>()
     {
         CallId = kind.CallId,
         ElementId = elementId,
         Argument = arg
     }));
 }
예제 #5
0
 public static void SendMessage <TArg>(InteropCall <IBrowserComponent, TArg> call, ElementId elementId, TArg arg)
 {
     JsRuntime.Invoke <object>(HandleMessageMethodFullName, new Message <TArg>()
     {
         CallId    = call.CallId,
         ElementId = elementId,
         Argument  = arg
     });
 }
예제 #6
0
 public static TResult Invoke <TArg, TResult>(InteropCall <IApplicationComponent, TArg, TResult> call, ElementId elementId, TArg arg)
 {
     //Console.WriteLine($"Browser.Invoking: {call.Name}");
     return(InvokeExternalMethod <TResult>(
                InteropAssemblyName,
                HandleMessageMethodName,
                new Message <TArg>()
     {
         CallId = call.CallId,
         ElementId = elementId,
         Argument = arg
     }));
 }
예제 #7
0
 public static void SendMessage <TArg>(InteropCall <IApplicationComponent, TArg> call, ElementId elementId, TArg arg)
 {
     //Console.WriteLine($"Browser.Sending: {call.Name}");
     InvokeExternalMethod <object>(
         InteropAssemblyName,
         HandleMessageMethodName,
         new Message <TArg>()
     {
         CallId    = call.CallId,
         ElementId = elementId,
         Argument  = arg
     });
 }
예제 #8
0
 private static InteropCall <IApplicationComponent> GetCall(int callId)
 {
     return((InteropCall <IApplicationComponent>)InteropCall.Get(callId));
 }
예제 #9
0
 private static InteropCall <IBrowserComponent> GetCall(int callId)
 {
     return(As <InteropCall <IBrowserComponent> >(InteropCall.Get(callId)));
 }
예제 #10
0
 private static bool Call(InteropCall <IApplicationComponent, InteropEvent, bool> call, ElementId id, InteropEvent e)
 {
     return(InteropBridge.Invoke(call, id, e));
 }
예제 #11
0
 private static void Send <TArg>(InteropCall <IApplicationComponent, TArg> call, ElementId id, TArg arg)
 {
     InteropBridge.SendMessage(call, id, arg);
 }
예제 #12
0
 private static void Fire(InteropCall <IApplicationComponent, None> call, ElementId id)
 {
     InteropBridge.SendMessage(call, id, default(None));
 }