void connection_ScriptReceived(object sender, ScriptEventArgs e)
 {
     try
     {
         e.Script["state"]       = State;
         e.Script["model"]       = Model;
         e.Script["sendMessage"] = new Action <String>(x => e.Connection.SendMessage(x));
         var result = e.Script.Run();
         if (result != null)
         {
             e.Connection.SendMessage(result.ToString());
         }
     }
     catch (Exception ex)
     {
         Log.Error(ex);
         e.Connection.SendMessage(ex.Message);
     }
 }
Beispiel #2
0
 void connection_ScriptReceived(object sender, ScriptEventArgs e)
 {
     Form.BeginInvoke(new Action(() => ProcessScriptRequest(e.Script, e.Connection)));
 }
Beispiel #3
0
 void connection_ScriptReceived(object sender, ScriptEventArgs e)
 {
     try
     {
         e.Script["state"] = State;
         e.Script["model"] = Model;
         e.Script["sendMessage"] = new Action<String>(x => e.Connection.SendMessage(x));
         var result = e.Script.Run();
         if (result != null)
             e.Connection.SendMessage(result.ToString());
     }
     catch (Exception ex)
     {
         Log.Error(ex);
         e.Connection.SendMessage(ex.Message);
     }
 }