예제 #1
0
 public void Forward(object message)
 {
     Debug.WriteDetail("Handling {0}", message.GetType());
     _provider.ConsumeMessage(message);
     if (message.GetType().Equals(typeof(ExternalCommandMessage)))
     {
         var commandMessage = (ExternalCommandMessage)message;
         Debug.WriteDebug("Handling external messag: " + commandMessage.Command + " from " + commandMessage.Sender);
         if (commandMessage.Sender == "EditorEngine")
         {
             var msg = EditorEngineMessage.New(commandMessage.Sender + " " + commandMessage.Command);
             Debug.WriteDebug(" args count is " + msg.Arguments.Count.ToString());
             if (msg.Arguments.Count == 1 &&
                 msg.Arguments[0].ToLower() == "shutdown")
             {
                 Debug.WriteDebug("Shutting down");
                 Close();
             }
             if (msg.Arguments.Count == 2 &&
                 msg.Arguments[0].ToLower() == "autotest.net" &&
                 msg.Arguments[1].ToLower() == "setfocus")
             {
                 Activate();
                 _provider.PrepareForFocus();
             }
         }
     }
 }
예제 #2
0
 public void Consume(object message)
 {
     _listener.IncomingMessage(message);
     if (message.GetType().Equals(typeof(ExternalCommandMessage)))
     {
         var commandMessage = (ExternalCommandMessage)message;
         if (commandMessage.Sender == "EditorEngine")
         {
             var msg = EditorEngineMessage.New(commandMessage.Sender + " " + commandMessage.Command);
             if (msg.Arguments.Count == 1 &&
                 msg.Arguments[0].ToLower() == "shutdown")
             {
                 Close();
             }
             if (msg.Arguments.Count == 2 &&
                 msg.Arguments[0].ToLower() == "autotest.net" &&
                 msg.Arguments[1].ToLower() == "setfocus")
             {
                 Activate();
                 _provider.PrepareForFocus();
             }
         }
     }
 }
 public void PrepareForFocus()
 {
     _provider.PrepareForFocus();
 }