client/src/Iri.Modernisation.Controls/ViewModel/ConsultationBookView/ConsultationBookViewVM.cs
--- a/client/src/Iri.Modernisation.Controls/ViewModel/ConsultationBookView/ConsultationBookViewVM.cs Fri Jan 08 11:33:24 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/ConsultationBookView/ConsultationBookViewVM.cs Thu Jan 14 16:39:50 2010 +0100
@@ -305,7 +305,7 @@
_title = param.SelectedBook.Title;
_author = param.SelectedBook.Author;
_chapters = param.SelectedBook.Chapters;
- //
+
if (param.SelectedBook.Chapters[0].VideoSequences.Count != 0)
{
ActualVideoSourceVM = new VideoViewerVM(true,false) { Source = param.SelectedBook.MediaPath };
@@ -323,17 +323,20 @@
private void ActualVideoSourceVM_Tick(object sender, VideoViewerVMEventArgs e)
{
- TimeSpan Pos = e.Position;
- SelectedBookVM.Position = Pos.TotalMilliseconds;
- if (SelectedIndex.TimerOut < Pos || SelectedIndex.TimerIn > Pos)
+ if(SelectedBook!=null)
{
- foreach (SegmentIndex Index in SelectedIndex.Chapter.Index)
+ TimeSpan Pos = e.Position;
+ SelectedBookVM.Position = Pos.TotalMilliseconds;
+ if (SelectedIndex.TimerOut < Pos || SelectedIndex.TimerIn > Pos)
{
- if (Index.TimerIn <= Pos && Index.TimerOut >= Pos)
+ foreach (SegmentIndex Index in SelectedIndex.Chapter.Index)
{
- SelectedIndex = Index;
+ if (Index.TimerIn <= Pos && Index.TimerOut >= Pos)
+ {
+ SelectedIndex = Index;
+ }
+
}
-
}
}
}