Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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();
            }
        }
Esempio n. 4
0
 private void DrawMissing()
 {
     previous = "Missing";
     Children.Add(IconCache.GetImage("question.ico"));
     this.ToolTip = GetStandardToolTip("Likely this item has not yet been saved.");
 }