|
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace DiagnosticExplorer.Silverlight
{
public class TraceParent : TraceItem
{
public TraceParent()
{
Children = new List<TraceItem>();
}
public TimeSpan EndTimeTotal { get; set; }
public TimeSpan EndTimeDelta { get; set; }
public TimeSpan Total
{
get { return EndTimeTotal - TimeTotal; }
}
public List<TraceItem> Children { get; private set; }
public override void Trace(TextWriter writer)
{
double seconds = EndTimeTotal.Subtract(TimeTotal).TotalSeconds;
writer.WriteLine("[{0:00.000}] [{1:00.000}] BEGIN {2} ({3:N3} seconds) {4}",
TimeTotal.TotalSeconds, TimeDelta.TotalSeconds, Text, seconds, InterestLevel);
//writer.Indent++;
foreach (TraceItem item in Children)
item.Trace(writer);
// writer.Indent--;
writer.WriteLine("[{0:00.000}] [{1:00.000}] BEGIN {2} ({3:N3} seconds) {4}",
EndTimeTotal.TotalSeconds, EndTimeDelta.TotalSeconds, Text, seconds, InterestLevel);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I am a software developer originally from Auckland, New Zealand. I have lived and worked in London since 2005.