public void WorkerThread()
{
try
{
// Now, actually run the graph
mediaControl.Run();
// The bulk of this thread's time is spent waiting
// for a stopEvent to occur. If the event is signaled
// then the media is stopped, and we exit the loop
while (!stopEvent.WaitOne(0, true))
{
Thread.Sleep(100);
}
mediaControl.StopWhenReady();
}
// catch any exceptions
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine("----: " + e.Message);
}
finally
{
}
}