public override void Update(BambooLog.Context context)
 {
     if (!context.FirstErrorFound && Severity == Model.MessageSeverity.Error)
     {
         context.FirstErrorFound = true;
         IsSelected = true;
     }
 }
        public override void Update(BambooLog.Context context)
        {
            records = model.Records.Select(x => createViewModel(x)).ToList();

            childErrorCount   = 0;
            childWarningCount = 0;
            TimeSpan maxChildDuration = TimeSpan.Zero;

            bool firstErrorFound = context.FirstErrorFound;

            foreach (var record in Records)
            {
                record.Update(context);
                childErrorCount   += record.getErrorCount();
                childWarningCount += record.getWarningCount();
                if (record.Duration > maxChildDuration)
                {
                    maxChildDuration = record.Duration;
                }
            }
            if (maxChildDuration != TimeSpan.Zero)
            {
                foreach (var record in Records)
                {
                    record.RelativeDuration = (double)record.Duration.Ticks / maxChildDuration.Ticks;
                }
            }
            if (!firstErrorFound)
            {
                if (childErrorCount > 0)
                {
                    IsExpanded = true;
                }
                else if (model.Failed)
                {
                    context.FirstErrorFound = true;
                    IsSelected = true;
                }
            }
        }
Beispiel #3
0
 public virtual void Update(BambooLog.Context context)
 {
 }