private void trackBarExTimeLine_Scroll(object sender, EventArgs e)
{
if (MainForm.GraphBuilder is ITimeShifting)
{
ITimeShifting timeShifting = MainForm.GraphBuilder as ITimeShifting;
TimeSpan start;
TimeSpan stop;
timeShifting.GetPositions(out start, out stop);
double currentPosition = (double)this.trackBarExTimeLine.Value / 1000.0;
TimeSpan position = TimeSpan.FromSeconds(currentPosition) + start;
timeShifting.SetPosition(position);
MainForm.SetVideoRefreshTimer();
}
else if (MainForm.GraphBuilder is IPlayer)
{
IPlayer player = MainForm.GraphBuilder as IPlayer;
double currentPosition = (double)this.trackBarExTimeLine.Value / 1000.0;
TimeSpan position = TimeSpan.FromSeconds(currentPosition);
player.SetPosition(position);
MainForm.SetVideoRefreshTimer();
}
}