Esempio n. 1
0
        void UpdateFixtureSummaryInstanceDeltaTotals(TextBlock textBlock, FixtureSummaries fixtureSummariesOld, FixtureSummaries fixtureSummariesNew)
        {
            int countNew   = fixtureSummariesNew.CountEvents();
            int countOld   = fixtureSummariesOld.CountEvents();
            int deltaCount = countNew - countOld;

            if (deltaCount == 0)
            {
                textBlock.Text = string.Empty;
            }
            else
            {
                if (deltaCount > 0)
                {
                    textBlock.Text       = "+" + deltaCount.ToString();
                    textBlock.Foreground = TwBrushes.GetPlusBrush();
                    textBlock.FontWeight = FontWeights.Bold;
                }
                else
                {
                    textBlock.Text       = deltaCount.ToString();
                    textBlock.Foreground = TwBrushes.GetMinusBrush();
                    textBlock.FontWeight = FontWeights.Bold;
                }
            }
        }
Esempio n. 2
0
        void UpdateFixtureSummaryInstanceDelta(TextBlock textBlock, FixtureSummaries fixtureSummariesNew, FixtureSummaries fixtureSummariesOld, FixtureClass fixtureClass)
        {
            int countNew   = fixtureSummariesNew[fixtureClass].Count;
            int countOld   = fixtureSummariesOld[fixtureClass].Count;
            int deltaCount = countNew - countOld;

            int countFirstCyclesNew   = fixtureSummariesNew[fixtureClass].FirstCycles;
            int countFirstCyclesOld   = fixtureSummariesOld[fixtureClass].FirstCycles;
            int deltaFirstCyclesCount = countFirstCyclesNew - countFirstCyclesOld;

            textBlock.Text    = string.Empty;
            textBlock.ToolTip = string.Empty;

            if (deltaCount == 0 && deltaFirstCyclesCount == 0)
            {
                return;
            }

            if (deltaCount != 0)
            {
                textBlock.ToolTip += "This action ";

                if (deltaCount > 0)
                {
                    textBlock.Text       = "+" + deltaCount.ToString();
                    textBlock.Foreground = TwBrushes.GetPlusBrush();
                    textBlock.FontWeight = FontWeights.Bold;
                    textBlock.ToolTip   += "increased ";
                }
                else
                {
                    textBlock.Text       = deltaCount.ToString();
                    textBlock.Foreground = TwBrushes.GetMinusBrush();
                    textBlock.FontWeight = FontWeights.Bold;
                    textBlock.ToolTip   += "decreased ";
                }
                textBlock.ToolTip += "the number of " + fixtureClass.FriendlyName + " events by " + Math.Abs(deltaCount) + ".";
                if (deltaFirstCyclesCount != 0)
                {
                    textBlock.ToolTip += "\r\n";
                }
            }

            if (deltaFirstCyclesCount != 0)
            {
                textBlock.ToolTip += "This action ";

                if (deltaFirstCyclesCount > 0)
                {
                    textBlock.Text      += WrapInParentheses("+" + deltaFirstCyclesCount.ToString());
                    textBlock.Foreground = TwBrushes.GetPlusBrush();
                    textBlock.FontWeight = FontWeights.Bold;
                    textBlock.ToolTip   += "increased ";
                }
                else if (deltaFirstCyclesCount < 0)
                {
                    textBlock.Text      += WrapInParentheses(deltaFirstCyclesCount.ToString());
                    textBlock.Foreground = TwBrushes.GetMinusBrush();
                    textBlock.FontWeight = FontWeights.Bold;
                    textBlock.ToolTip   += "decreased ";
                }
                textBlock.ToolTip += "the number of " + fixtureClass.FriendlyName + " 1st cycles by " + Math.Abs(deltaFirstCyclesCount) + ".";
            }
        }