public ITaskTimer StartTask(string name, ITaskTimer parentTaskTimer) { var taskTimer = new TaskTimer { Id = Guid.NewGuid(), Name = name, StartedTime = DateTime.Now, Disposer = DisposeTaskTimer, Parent = parentTaskTimer, }; if (parentTaskTimer != null) { parentTaskTimer.AddChild(taskTimer); } return(taskTimer); }
private void DisposeTaskTimer(TaskTimer taskTimer) { if (taskTimer.IsDisposed) { // No need to do anything at all! return; } taskTimer.StopedTime = DateTime.Now; if (taskTimer.Parent != null) { return; } var stringBuilder = new StringBuilder(); RenderTaskTimer(taskTimer, stringBuilder, 0); Information(stringBuilder.ToString()); }
public ITaskTimer StartTask(string name, ITaskTimer parentTaskTimer) { var taskTimer = new TaskTimer { Id = Guid.NewGuid(), Name = name, StartedTime = DateTime.Now, Disposer = DisposeTaskTimer, Parent = parentTaskTimer, }; if (parentTaskTimer != null) { parentTaskTimer.AddChild(taskTimer); } return taskTimer; }