public void DrawTest() { var fast = double.IsNaN(entry.AverageTimeUnder) || entry.TimesCalled == 0 || entry.AverageTimeUnder < .800; //TODO GREG PUT ON FEATURE TOGGLE fast = true; var icon = fast ? IconCache.GetImage("check.ico") : IconCache.GetImage("gary.ico"); if (icon == null) { icon = IconCache.GetImage("defaulttest.ico"); } if (icon == null) { return; } Children.Add(icon); if (previous == "FAST" && !fast) { ShowAndCloseTip("Sigh. It used to be fast.\nLook at sequence diagram to see issue."); } if (previous == "SLOW" && fast) { ShowAndCloseTip("Looks better now."); } if (previous == "MISSING" && !fast) { ShowAndCloseTip("Meow, let's try not using nHibernate in the test this time"); } previous = double.IsNaN(entry.AverageTimeUnder) || entry.TimesCalled == 0 || entry.AverageTimeUnder < .800 ? "FAST" : "SLOW"; this.ToolTip = BuildTestToolTip(""); }
private void DrawFailure(string name, string text) { var icon = IconCache.GetImage("redx.ico"); if (icon == null) { return; } icon.ToolTip = GetStandardToolTip(name + " Failed" + text);; Children.Add(icon); }
private void DrawIgnored(string name, string text) { var icon = IconCache.GetImage("ignored.ico"); if (icon == null) { return; } icon.ToolTip = GetStandardToolTip(name + " Ignored\n" + text); Children.Add(icon); }
public void DrawNormalMethod() { if (this.riskTag.Signature.Element.Kind == vsCMElement.vsCMElementVariable) { return; } if (entry.RiskMetric < 20 && entry.NumberOfAssociatedTests < 3 && entry.NodeCount > 50) { previous = "DRAGON"; Children.Add(IconCache.GetImage("dragon.ico")); this.ToolTip = GetStandardToolTip("Beware all ye that enter these realms.\n\nIn the old days they drew dragons on the map as warnings\nThis is yours."); } else { var brush = new RadialGradientBrush(); brush.GradientOrigin = new Point(0.25, 0.15); var stops = new GradientStopCollection(); var ellipse = new Ellipse { Height = Height + 1, Width = Width + 1, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center }; if (entry.RiskMetric >= 70) { stops.Add(new GradientStop(Colors.LimeGreen, 0.2)); stops.Add(new GradientStop(Colors.Green, 0.9)); brush.GradientStops = stops; ellipse.Fill = brush; ellipse.Stroke = new SolidColorBrush(Colors.Green); } else if (entry.RiskMetric > 30 && entry.RiskMetric < 70) { stops.Add(new GradientStop(Colors.LightGoldenrodYellow, 0.2)); stops.Add(new GradientStop(Colors.Yellow, 0.9)); brush.GradientStops = stops; ellipse.Fill = brush; ellipse.Stroke = new SolidColorBrush(Colors.Yellow); } else { stops.Add(new GradientStop(Colors.DarkOrange, 0.2)); stops.Add(new GradientStop(Colors.Red, 0.9)); brush.GradientStops = stops; ellipse.Fill = brush; ellipse.Stroke = new SolidColorBrush(Colors.Red); } Children.Add(ellipse); var testOutput = entry.NumberOfAssociatedTests > 99 ? "+" : entry.NumberOfAssociatedTests.ToString(); var text = new TextBlock { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Text = testOutput, Foreground = Brushes.White, FontFamily = new FontFamily("Tahoma"), FontSize = 10, FontWeight = FontWeights.Bold }; if (entry.RiskMetric > 30 && entry.RiskMetric < 70) { text.Foreground = Brushes.Black; } if (previous == "DRAGON") { ShowAndCloseTip("You have vanquished the dragon.\n\nMay all bow before you."); } Children.Add(text); //TextBlock textBlock = new TextBlock(); //textBlock.Foreground = Brushes.White; //textBlock.HorizontalAlignment = HorizontalAlignment.Center; //textBlock.VerticalAlignment = VerticalAlignment.Center; //textBlock.Text = ; //Grid toolTipPanel = new Grid(); //toolTipPanel.Children.Add(textBlock); //this.ToolTip = toolTipPanel; //ToolTipService.SetToolTip(this, toolTipPanel); this.ToolTip = BuildRegToolTip(); } }
private void DrawMissing() { previous = "Missing"; Children.Add(IconCache.GetImage("question.ico")); this.ToolTip = GetStandardToolTip("Likely this item has not yet been saved."); }