public void ProcessMessage(MessageReceivedEventArgs e)
 {
     try
     {
         Logger.Write("Risk: Message Found of " + e.Message.GetType());
         if (e.Message.GetType() == typeof(RiskMetricGeneratedMessage))
         {
             var message = (RiskMetricGeneratedMessage)e.Message;
             Logger.Write("Received risk metric from backend for " + message.Signature + " count = " +
                          message.NodeCount);
             EntryCache.Update(message);
         }
         if (e.Message.GetType() == typeof(ProfilerCompletedMessage) ||
             e.Message.GetType() == typeof(ProfilerInitializedMessage) ||
             e.Message.GetType() == typeof(AssembliesMinimizedMessage) ||
             e.Message.GetType() == typeof(MinimizerInitializedMessage))
         {
             Logger.Write("LL:Received Profiler Message: Invalidating.");
             EntryCache.Invalidate();
         }
         if (e.Message.GetType() == typeof(CacheMessages))
         {
             CurrentTestStatuses.UpdateWith((CacheMessages)e.Message);
         }
     }
     catch (Exception ex)
     {
         Logger.Write("Process message" + ex);
     }
 }
Exemple #2
0
        public void SetUIElements()
        {
            Children.Clear();
            var status = CurrentTestStatuses.GetStatusOf(entry.Signature);

            if (status != null && status.status == TestStatus.Fail)
            {
                DrawFailure(status.Name, status.text);
            }
            else if (status != null && status.status == TestStatus.Ignored)
            {
                DrawIgnored(status.Name, status.text);
            }
            else if (!entry.IsFilled)
            {
                DrawWaiting();
            }
            else
            {
                if (entry.IsTest)
                {
                    DrawTest();
                }
                else if (!entry.Exists)
                {
                    DrawMissing();
                }
                else
                {
                    DrawNormalMethod();
                }
            }
            InvalidateVisual();
        }