diff -r c031f1132dde -r a9c815025a1b client/src/Iri.Modernisation.Controls/ViewModel/BookTimeLine/BookTimeLineVM.cs --- a/client/src/Iri.Modernisation.Controls/ViewModel/BookTimeLine/BookTimeLineVM.cs Wed Dec 16 17:14:38 2009 +0100 +++ b/client/src/Iri.Modernisation.Controls/ViewModel/BookTimeLine/BookTimeLineVM.cs Fri Dec 18 16:45:30 2009 +0100 @@ -19,10 +19,11 @@ /// public class BookTimeLineVM : BaseMVVM.ViewModel.ViewModel { + + private VideoBook _selectedBook; /// /// Livre sélectionné /// - private VideoBook _selectedBook; public VideoBook SelectedBook { get @@ -32,20 +33,21 @@ } /// - /// + /// Nom de l'auteur /// public String AuthorFullname { get { - return Author.FirstName + " " + Author.Name; + return Author.UserName; } } + + private String _title; /// /// Titre du Livre /// - private String _title; public String Title { get @@ -60,10 +62,11 @@ } } + + private User _author; /// /// Auteur du Livre /// - private User _author; public User Author { get @@ -79,10 +82,10 @@ } + private VideoChapter[] _chapters; /// /// Chapitre du Livre /// - private VideoChapter[] _chapters; public VideoChapter[] Chapters { get @@ -97,10 +100,11 @@ } } + + private List[] _segmentIndex=new List[4]; /// /// Liste des Index des Chapitres /// - private List[] _segmentIndex=new List[4]; public List[] SegmentIndex { get @@ -114,10 +118,11 @@ } } + + private List[] _annotations=new List[4]; /// /// Liste des Annotations /// - private List[] _annotations=new List[4]; public List[] Annotations { get @@ -131,10 +136,11 @@ } } + + private TimeSpan _totalDuration; /// /// Durée totale du Livre /// - private TimeSpan _totalDuration; public double TotalDuration { get @@ -149,55 +155,11 @@ } } - private List _polemicSpectrumData = new List(); - public List PolemicSpectrumData - { - get - { - return _polemicSpectrumData; - } - } - - private List _adhesionSpectrumData = new List(); - public List AdhesionSpectrumData - { - get - { - return _adhesionSpectrumData; - } - } - - private List _referenceSpectrumData = new List(); - public List ReferenceSpectrumData - { - get - { - return _referenceSpectrumData; - } - } - - private List _questionSpectrumData = new List(); - public List QuestionSpectrumData - { - get - { - return _questionSpectrumData; - } - } - - private List _generalSpectrumData = new List(); - public List GeneralSpectrumData - { - get - { - return _generalSpectrumData; - } - } - + + private double _position; /// /// Position du curseur de lecture /// - private double _position; public double Position { get @@ -211,53 +173,7 @@ } } - /// - /// Chargement des données et annalyse - /// - private void LoadData() - { - if (_selectedBook.Duration != TimeSpan.Zero) - { - - for (double i = 0; i <= _selectedBook.Duration.TotalMilliseconds; i = (i + _selectedBook.Duration.TotalMilliseconds / 150)) - { - int[] Tem = new int[4]{0,0,0,0}; - foreach (VideoChapter Ch in _selectedBook.Chapters) - { - foreach (Annotation An in Ch.Annotations) - { - if (An.TimerIn.TotalMilliseconds <= i && An.TimerOut.TotalMilliseconds >= i) - { - switch (An.Type) - { - case PolemicElementType.Polemic: - Tem[0]++; - break; - case PolemicElementType.Adhesion: - Tem[1]++; - break; - case PolemicElementType.Reference: - Tem[2]++; - break; - case PolemicElementType.Question: - Tem[3]++; - break; - default: - break; - } - } - } - } - _polemicSpectrumData.Add(Tem[0]); - _adhesionSpectrumData.Add(Tem[1]); - _referenceSpectrumData.Add(Tem[2]); - _questionSpectrumData.Add(Tem[3]); - _generalSpectrumData.Add((Tem[0]+Tem[1]+Tem[2]+Tem[3])); - } - } - - - } + /// /// Constructeur @@ -270,12 +186,15 @@ _author = bookParam.Author; _chapters = bookParam.Chapters; _totalDuration = bookParam.Duration; - LoadData(); LoadElements(); Commands.TimeChange.Executed += new EventHandler(TimeChange_Executed); } + private VideoViewerVM _videoViewerVM; + /// + /// ViewModel de VideoViewer + /// public VideoViewerVM ViewModelVideoViewer { get @@ -288,17 +207,12 @@ OnPropertyChanged("ViewModelVideoViewer"); } } - void TimeChange_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) + private void TimeChange_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) { - // Position = ((Slider)e.Parameter).Value; - // Commands.VideoViewer.Pause.Execute(); if(e.Source == this) { ViewModelVideoViewer.GoTo(TimeSpan.FromMilliseconds(((double)e.Parameter))); } - //Commands.GoToTime.Execute(((Slider)e.Parameter).Value); - - // Commands.VideoViewer.Play.Execute(); }