Ejemplo n.º 1
0
        private void SetRowAnnotations(DevExpress.XtraGrid.Views.Grid.GridCustomScrollAnnotationsEventArgs e, LogItem.State state, Color color)
        {
            var errorDatasourceIndexes = _aggregatedLogs
                                         .Where(l => l.AccumulatedState == state)
                                         .Select(l => _aggregatedLogs.IndexOf(l))
                                         .ToArray();

            var errorRowHandles = errorDatasourceIndexes
                                  .Select(i => viewLog.GetRowHandle(i))
                                  .Select(h => new DevExpress.XtraGrid.Views.Grid.GridScrollAnnotationInfo()
            {
                Color = color, RowHandle = h
            })
                                  .ToArray();

            e.Annotations.AddRange(errorRowHandles);
        }
Ejemplo n.º 2
0
        private void ViewLog_CustomScrollAnnotation(object sender, DevExpress.XtraGrid.Views.Grid.GridCustomScrollAnnotationsEventArgs e)
        {
            if (e.Annotations == null)
            {
                e.Annotations = new List <DevExpress.XtraGrid.Views.Grid.GridScrollAnnotationInfo>();
            }
            else
            {
                e.Annotations.Clear();
            }

            if (_aggregatedLogs == null)
            {
                return;
            }

            SetRowAnnotations(e, LogItem.State.Error, Color.Red);
            SetRowAnnotations(e, LogItem.State.Warning, Color.Orange);
        }