Esempio n. 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();
             }
         }
     }
 }
 public void IncomingMessage(object message)
 {
     Logger.Write(string.Format("Handling {0}", message.GetType()));
     if (message.GetType().Equals(typeof(InvalidLicenseMessage)))
     {
         _view.PrintMessage(new RunMessages(RunMessageType.Normal, "To start using ContinuousTests go to ContinuousTests->About and register the application."));
     }
     else if (message.GetType().Equals(typeof(ValidLicenseMessage)))
     {
         _view.PrintMessage(new RunMessages(RunMessageType.Normal, "Engine started and waiting for changes."));
     }
     else if (message.GetType().Equals(typeof(AutoTest.Client.Config.MMConfiguration)))
     {
         var config = (AutoTest.Client.Config.MMConfiguration)message;
         _view.SetVisibilityConfiguration(
             config.BuildErrorsInFeedbackWindow,
             config.BuildWarningsInFeedbackWindow,
             config.FailingTestsInFeedbackWindow,
             config.BuildWarningsInFeedbackWindow);
         _view.ShowRunInformation = !config.RealtimeFeedback;
     }
     else if (message.GetType().Equals(typeof(ProfiledTestRunStarted)))
     {
         _view.SetProgress(true, "Loading profiler information", Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "progress-light.gif"));
     }
     else if (message.GetType().Equals(typeof(ProfilerCompletedMessage)))
     {
         setProgressFinished();
     }
     else if (message.GetType().Equals(typeof(RunStartedMessage)))
     {
         Analytics.SendEvent("RunStarted");
         _view.ConsumeMessage(message);
     }
     else if (message.GetType().Equals(typeof(RunFinishedMessage)))
     {
         sendAnalytics((RunFinishedMessage)message);
         _lastTestRunStatus = setRunStatus((RunFinishedMessage)message);
         _view.ConsumeMessage(message);
     }
     else
     {
         _view.ConsumeMessage(message);
     }
 }
Esempio n. 3
0
 public void Consume(object message)
 {
     _provider.ConsumeMessage(message);
 }