private void SetChildOpenCondition(FixtureSummary summary, IEnumerable <FixtureContent> fixtureContents)
    {
        var limit = 50;

        if (summary.TotalCount <= limit)
        {
            SetChildOpen(fixtureContents, true);
            return;
        }

        var assemblyFixtureContents = fixtureContents.ToList();

        if (GetChildFixtureCount(assemblyFixtureContents) > limit)
        {
            return;
        }

        SetChildOpen(assemblyFixtureContents);
        limit -= assemblyFixtureContents.Count;

        var namespaceFixtureContents = assemblyFixtureContents.SelectMany(fixtureContent => fixtureContent.Fixtures).ToList();

        if (GetChildFixtureCount(namespaceFixtureContents) > limit)
        {
            return;
        }

        SetChildOpen(namespaceFixtureContents);
    }
Beispiel #2
0
        Path DrawWedge(double radius, double startAngle, out double endAngle, FixtureSummary fixtureSummary)
        {
            Path path = new Path();

            Canvas.SetLeft(path, radius);
            Canvas.SetTop(path, radius);

            path.Fill = TwBrushes.FrozenSolidColorBrush(fixtureSummary.FixtureClass);

            PathGeometry pathGeometry = new PathGeometry();
            PathFigure   pathFigure   = new PathFigure();

            pathFigure.StartPoint = new Point(0, 0);
            pathFigure.IsClosed   = true;

            Point       startArc    = new Point(Math.Cos(startAngle * Math.PI / 180) * radius, Math.Sin(startAngle * Math.PI / 180) * radius);
            LineSegment lineSegment = new LineSegment(startArc, true);

            ArcSegment arcSegment = new ArcSegment();
            double     percent    = ByInstances ? fixtureSummary.PercentCount : fixtureSummary.PercentVolume;

            double angle;

            if (fixtureSummary.PercentCount == 1)
            {
                angle = 359.99; // WPF won't draw a wedge from 0 to 360 degrees, so we fake it
            }
            else
            {
                angle = percent * 360;
            }

            arcSegment.IsLargeArc     = angle >= 180.0;
            arcSegment.Point          = new Point(Math.Cos((startAngle + angle) * Math.PI / 180) * radius, Math.Sin((startAngle + angle) * Math.PI / 180) * radius);
            arcSegment.Size           = new Size(radius, radius);
            arcSegment.SweepDirection = SweepDirection.Clockwise;

            pathFigure.Segments.Add(lineSegment);
            pathFigure.Segments.Add(arcSegment);

            pathGeometry.Figures.Add(pathFigure);
            path.Data = pathGeometry;

            endAngle = startAngle + angle;

            if (!IsEnlargeable)
            {
                if (ByInstances)
                {
                    path.ToolTip = new PieChartToolTip(fixtureSummary.FixtureClass, ByInstances, fixtureSummary.Count.ToString(), fixtureSummary.PercentCount);
                }
                else
                {
                    path.ToolTip = new PieChartToolTip(fixtureSummary.FixtureClass, ByInstances, fixtureSummary.Volume.ToString("0.0"), fixtureSummary.PercentVolume);
                }
            }
            ToolTipService.SetShowDuration(path, 60000);
            ToolTipService.SetInitialShowDelay(path, 500);

            return(path);
        }
Beispiel #3
0
 public EventsProperties(FixtureClass fixtureClassPredicted, FixtureClass fixtureClassActual, FixtureSummary fixtureSummary)
 {
     CreateEventsProperties(fixtureClassPredicted, "Predicted", fixtureClassActual, "Actual", fixtureSummary.Events, fixtureSummary.Count, false);
 }