* Main.cs, ExampleBrowser.cs:

Fixed display of debug output in the sample browser.
This commit is contained in:
the_fiddler 2010-12-08 07:51:41 +00:00
parent 5c23242665
commit 4ef9b876ab
2 changed files with 2 additions and 10 deletions

View file

@ -94,7 +94,6 @@ namespace Examples
imageListSampleCategories.Images.Add("3.x", Resources.v3x); imageListSampleCategories.Images.Add("3.x", Resources.v3x);
imageListSampleCategories.Images.Add("4.x", Resources.v4x); imageListSampleCategories.Images.Add("4.x", Resources.v4x);
Debug.Listeners.Add(new TextBoxTraceListener(textBoxOutput));
treeViewSamples.TreeViewNodeSorter = new SamplesTreeViewSorter(); treeViewSamples.TreeViewNodeSorter = new SamplesTreeViewSorter();
LoadSamplesFromAssembly(Assembly.GetExecutingAssembly()); LoadSamplesFromAssembly(Assembly.GetExecutingAssembly());
@ -354,7 +353,7 @@ namespace Examples
return -1; return -1;
} }
static void RunSample(Control parent, ExampleInfo e) void RunSample(Control parent, ExampleInfo e)
{ {
if (e == null) if (e == null)
return; return;
@ -389,6 +388,7 @@ namespace Examples
{ {
if (parent != null) if (parent != null)
{ {
textBoxOutput.Text = File.ReadAllText("debug.log");
parent.Visible = true; parent.Visible = true;
Application.DoEvents(); Application.DoEvents();
} }

View file

@ -59,14 +59,6 @@ namespace Examples
MessageBox.Show("Could not access debug.log", expt.ToString()); MessageBox.Show("Could not access debug.log", expt.ToString());
} }
Debug.Listeners.Clear();
Debug.Listeners.Add(new TextWriterTraceListener("debug.log"));
Debug.Listeners.Add(new ConsoleTraceListener());
Trace.Listeners.Clear();
Trace.Listeners.Add(new TextWriterTraceListener("debug.log"));
Trace.Listeners.Add(new ConsoleTraceListener());
Application.Run(browser); Application.Run(browser);
} }
} }