public TimerEvent AddEvent(string message, string category = "ASP.NET", string description = null) { if (!Categories.Where(c => c.Key == category).Any()) Categories.Add(category, new TimerCategory{EventColor = "#BBB", EventColorHighlight = "#BBB"}); var result = new TimerEvent(message, category, description, Stopwatch); result.Stopped += (startPoint, duration) => { var d = startPoint + duration - StartPoint; Duration = (long)((int)d * 1.01);//TODO: Fix this hack to add right padding on timeline }; Events.Add(result); if (Events.Count == 1) StartPoint = result.StartPoint; return result; }
public TimerEvent AddEvent(string message, string category = "ASP.NET", string description = null) { if (!Categories.Where(c => c.Key == category).Any()) Categories.Add(category, new TimerCategory{EventColor = "#BBB", EventColorHighlight = "#BBB"}); var result = new TimerEvent(message, category, description, Stopwatch); Events.Add(result); return result; }