Пример #1
0
 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);
     }
 }
Пример #2
0
 public static void UpdateWith(CacheMessages message)
 {
     foreach (var item in message.TestsToRemove)
     {
         var str = ConvertFromRunner(item);
         Logger.Write("removing test. " + str);
         _status.Remove(str);
         EntryCache.InvalidateNoUpdate(str);
     }
     foreach (var item in message.FailedToAdd)
     {
         var str = ConvertFromRunner(item);
         Logger.Write("Adding failed test. " + str);
         _status[str] = new TestStatusNode {
             Name = item.Test.Name, status = TestStatus.Fail, text = item.Test.Message
         };
         EntryCache.InvalidateNoUpdate(str);
     }
     foreach (var item in message.IgnoredToAdd)
     {
         var str = ConvertFromRunner(item);
         Logger.Write("Adding ignored test. " + str);
         _status[str] = new TestStatusNode {
             Name = item.Test.Name, status = TestStatus.Ignored, text = item.Test.Message
         };
         EntryCache.InvalidateNoUpdate(str);
     }
 }
Пример #3
0
 public MarginUIElement(RiskTag riskTag, IWpfTextViewLine line)
 {
     this.riskTag       = riskTag;
     _line              = line;
     entry              = EntryCache.GetRiskEntryFor(riskTag.Signature.StringSignature);
     entry.Changed     += Refresh;
     entry.Invalidated += CheckUpdate;
     IsVisibleChanged  += MarginUIElement_IsVisibleChanged;
     SetUIElements();
 }
Пример #4
0
 public void Update()
 {
     EntryCache.Update(Signature);
 }