Beispiel #1
0
        internal List <AggregateLogItem> Aggregate(List <LogItem> logs)
        {
            var result = new List <AggregateLogItem>();

            AggregateLogItem aggregate = null;

            var orderedLogs = logs
                              .OrderBy(l => l.DisplayName)
                              .ThenBy(l => l.TimeStampUtc)
                              .ToList();

            foreach (var log in orderedLogs)
            {
                if (aggregate?.CanAggregate(log) ?? false)
                {
                    aggregate.AddItem(log);
                    continue;
                }

                aggregate = new AggregateLogItem(log);
                result.Add(aggregate);
            }

            return(result);
        }
Beispiel #2
0
            public void Aggregates_The_State_To_The_Worst_Case(LogItem.State firstState, LogItem.State secondState, LogItem.State expectedState)
            {
                var aggregate = new AggregateLogItem(new LogItem()
                {
                    AccumulatedState = firstState
                });

                aggregate.AddItem(new LogItem()
                {
                    AccumulatedState = secondState
                });
                aggregate.AccumulatedState.Should().Be(expectedState);
            }
Beispiel #3
0
        private void ShowDetailForm(AggregateLogItem item)
        {
            const int FORM_Y_OFFSET = 30;

            var form = new ItemDetailForm
            {
                Item   = item,
                Height = this.Height - FORM_Y_OFFSET,
                Top    = this.Top + FORM_Y_OFFSET
            };

            form.Width = Math.Max(form.Width, this.Width / 2);
            form.Left  = this.Left + ((this.Width - form.Width) / 2);

            form.ShowDialog(this);
        }
Beispiel #4
0
        private void ShowDetailForm(AggregateLogItem item)
        {
            const int FORM_Y_OFFSET = 5;

            if (_detailForm == null)
            {
                _detailForm = new ItemDetailForm();
            }

            _detailForm.Bounds = new Rectangle(
                this.Left + ((this.Width - _detailForm.Width) / 2),
                this.Top + FORM_Y_OFFSET,
                Math.Max(_detailForm.Width, this.Width / 2),
                this.Height - FORM_Y_OFFSET * 2);

            _detailForm.Item              = item;
            _detailForm.FormBorderEffect  = FormBorderEffect.Glow;
            _detailForm.InactiveGlowColor = ColorService.GetColor(item.AccumulatedState);
            _detailForm.ActiveGlowColor   = _detailForm.InactiveGlowColor;

            _detailForm.ShowDialog(this);
        }
Beispiel #5
0
        private void ShowDetailForm(AggregateLogItem item)
        {
            const int FORM_Y_OFFSET = 5;

            if (_detailForm == null)
            {
                using (var hint = HintForm.Show(this, "Initializing Editor ..."))
                {
                    _detailForm = new ItemDetailForm();
                    hint.Close();
                }
            }

            _detailForm.Bounds = new Rectangle(
                this.Left + ((this.Width - _detailForm.Width) / 2),
                this.Top + FORM_Y_OFFSET,
                Math.Max(_detailForm.Width, this.Width / 2),
                this.Height - FORM_Y_OFFSET * 2);

            _detailForm.Item          = item;
            _detailForm.ItemNavigator = this;

            _detailForm.ShowDialog(this);
        }