|
using System;
using System.CodeDom.Compiler;
using System.IO;
using System.Linq;
using System.Text;
namespace DiagnosticExplorer.Silverlight
{
public class TraceItem
{
public TraceItem()
{
InterestLevel = InterestLevel.Low;
}
public string Text { get; set; }
public string Detail { get; set; }
public bool Expanded { get; set; }
public InterestLevel InterestLevel { get; set; }
public TimeSpan TimeTotal { get; set; }
public TimeSpan TimeDelta { get; set; }
public override string ToString()
{
return string.Format("[{0:00.000}] [{1:00.000}] {2} {3}", TimeTotal.TotalSeconds, TimeDelta.TotalSeconds, Text, InterestLevel);
}
public string GetTraceString()
{
TextWriter writer = new StringWriter();
//IndentedTextWriter writer = new IndentedTextWriter(stringWriter);
Trace(writer);
return writer.ToString();
}
public virtual void Trace(TextWriter writer)
{
writer.WriteLine("[{0:00.000}] [{1:00.000}] {2} {3}", TimeTotal.TotalSeconds, TimeDelta.TotalSeconds, Text, 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.