void pumperBGW_DoWork(object sender, DoWorkEventArgs e)
{
if (SkeletonFrameReady == null)
return;
foreach (SkeletonCapture capture in loadedCaptures)
{
if (UseDelay)
System.Threading.Thread.Sleep((int)capture.DelayInMilliSeconds);
if (uiDispatcher != null)
{
uiDispatcher.Invoke((Action)delegate
{
SkeletonFrameReady(this, new PlayerSkeletonFrameReadyEventArgs() { DelayInMilliSeconds = capture.DelayInMilliSeconds, FrameSkeleton = capture.Skeleton });
}, null);
}
if (uiDispatcher == null)
{
SkeletonFrameReady(this, new PlayerSkeletonFrameReadyEventArgs() { DelayInMilliSeconds = capture.DelayInMilliSeconds, FrameSkeleton = capture.Skeleton });
}
}
}