# HG changeset patch # User Matthieu Totet # Date 1258992300 -3600 # Node ID 12515e11b357e5617ace3de0ae96cc001302b2e8 # Parent 185e3ab53a568365da145ccffed1261529c2e2a0 Update PolemicElement View : Can Display Correct Color of VideoChapter diff -r 185e3ab53a56 -r 12515e11b357 client/src/Iri.Modernisation.Controls/Converter/PolemicTypeColorConverter.cs --- a/client/src/Iri.Modernisation.Controls/Converter/PolemicTypeColorConverter.cs Mon Nov 23 14:52:34 2009 +0100 +++ b/client/src/Iri.Modernisation.Controls/Converter/PolemicTypeColorConverter.cs Mon Nov 23 17:05:00 2009 +0100 @@ -16,35 +16,63 @@ { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { - return Convert((PolemicElementType)value); + return Convert(value); } - public static Brush Convert(PolemicElementType value) + public static Brush Convert(object value) { - PolemicElementType dt = (PolemicElementType)value; - SolidColorBrush returnBrush; - switch (dt) + SolidColorBrush returnBrush = new SolidColorBrush(new Color() { A = 255, R = 255, G = 255, B = 255 }); + if (value is PolemicElementType) { - case PolemicElementType.Basic: - returnBrush = new SolidColorBrush(new Color() { A = 255, R = 255, G = 255, B = 255 }); - break; - case PolemicElementType.Polemic: - returnBrush = new SolidColorBrush(new Color() { A = 255, R = 255, G = 0, B = 0 }); - break; - case PolemicElementType.Adhesion: - returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0, G = 255, B = 0 }); - break; - case PolemicElementType.Reference: - returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0, G = 0, B = 255 }); - break; - case PolemicElementType.Question: - returnBrush = new SolidColorBrush(new Color() { A = 255, R = 255, G = 255, B = 0 }); - break; - default: - returnBrush = new SolidColorBrush(new Color() { A = 255, R = 255, G = 255, B = 255 }); - break; + PolemicElementType dt = (PolemicElementType)value; + + switch (dt) + { + case PolemicElementType.Basic: + returnBrush = new SolidColorBrush(new Color() { A = 255, R = 255, G = 255, B = 255 }); + break; + case PolemicElementType.Polemic: + returnBrush = new SolidColorBrush(new Color() { A = 255, R = 255, G = 0, B = 0 }); + break; + case PolemicElementType.Adhesion: + returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0, G = 255, B = 0 }); + break; + case PolemicElementType.Reference: + returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0, G = 0, B = 255 }); + break; + case PolemicElementType.Question: + returnBrush = new SolidColorBrush(new Color() { A = 255, R = 255, G = 255, B = 0 }); + break; + default: + returnBrush = new SolidColorBrush(new Color() { A = 255, R = 255, G = 255, B = 255 }); + break; + } + } - return returnBrush; + else if(value is VideoChapterType) + { + VideoChapterType dt = (VideoChapterType)value; + switch (dt) + { + case VideoChapterType.Modernite: + returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0xD6, G = 0xA3, B = 0x82 }); + break; + case VideoChapterType.Modernisation: + returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0xBF, G = 0xA8, B = 0x4E }); + break; + case VideoChapterType.Postmodernite: + returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0xB5, G = 0xCB, B = 0x29 }); + break; + case VideoChapterType.Ouverture: + returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0x5B, G = 0xCC, B = 0x5B }); + break; + default: + break; + } + + } + + return returnBrush; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { @@ -52,5 +80,19 @@ throw new NotImplementedException(); } + /* + case VideoChapterType.Modernite: + returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0xD6, G = 0xA3, B = 0x82 }); + break; + case VideoChapterType.Modernisation: + returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0xBF, G = 0xA8, B = 0x4E}); + break; + case VideoChapterType.Postmodernite: + returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0xB5, G = 0xCB, B = 0x29 }); + break; + case VideoChapterType.Ouverture: + returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0x5B, G = 0xCC, B = 0x5B }); + break; + */ } } diff -r 185e3ab53a56 -r 12515e11b357 client/src/Iri.Modernisation.Controls/Iri.Modernisation.Controls.csproj --- a/client/src/Iri.Modernisation.Controls/Iri.Modernisation.Controls.csproj Mon Nov 23 14:52:34 2009 +0100 +++ b/client/src/Iri.Modernisation.Controls/Iri.Modernisation.Controls.csproj Mon Nov 23 17:05:00 2009 +0100 @@ -79,7 +79,7 @@ - + diff -r 185e3ab53a56 -r 12515e11b357 client/src/Iri.Modernisation.Controls/ViewModel/PolemicElementVM.cs --- a/client/src/Iri.Modernisation.Controls/ViewModel/PolemicElementVM.cs Mon Nov 23 14:52:34 2009 +0100 +++ b/client/src/Iri.Modernisation.Controls/ViewModel/PolemicElementVM.cs Mon Nov 23 17:05:00 2009 +0100 @@ -188,7 +188,7 @@ /// /// PolemicType de l'élément /// - public PolemicElementType Type + public object Type { get { @@ -196,6 +196,10 @@ { return ((Annotation)_element).Type; } + else if(_element is SegmentIndex) + { + return ((SegmentIndex)_element).Chapter.Type; + } else { return PolemicElementType.Basic; diff -r 185e3ab53a56 -r 12515e11b357 client/src/Iri.Modernisation.Data/ClassDiagram1.cd --- a/client/src/Iri.Modernisation.Data/ClassDiagram1.cd Mon Nov 23 14:52:34 2009 +0100 +++ b/client/src/Iri.Modernisation.Data/ClassDiagram1.cd Mon Nov 23 17:05:00 2009 +0100 @@ -71,8 +71,8 @@ - - + + @@ -89,7 +89,7 @@ - AAAAAAAAAEAAAEBAAAAAAAAAQAAAAAAAAAEAAAAAAAA= + AAAAAAAAAEAAAEBAAAAAAAAAQAAAAAAAAQEAAAAAAAA= Models\VideoChapter.cs diff -r 185e3ab53a56 -r 12515e11b357 client/src/Iri.Modernisation.Data/Ldt/Readers.cs --- a/client/src/Iri.Modernisation.Data/Ldt/Readers.cs Mon Nov 23 14:52:34 2009 +0100 +++ b/client/src/Iri.Modernisation.Data/Ldt/Readers.cs Mon Nov 23 17:05:00 2009 +0100 @@ -55,16 +55,32 @@ // Initialisation des index foreach (LDTAnnotationsContent LDTAC in _ldtFile.Annotations) { + int count=0; + int decoupage = LDTAC.Content[2].Elements.Count/4; + int selectedChapter = 0; foreach(LDTElement LDTE in LDTAC.Content[2].Elements) { - _videoBook.Chapters[0].Index.Add(new SegmentIndex(_videoBook.Chapters[0]) + + + _videoBook.Chapters[selectedChapter].Index.Add(new SegmentIndex(_videoBook.Chapters[selectedChapter]) { Title = LDTE.Title, Description = LDTE.Abstract, Tags = LDTE.Tags, TimerIn = new TimeSpan(0, 0, 0, 0, (int)LDTE.Begin), Duration = new TimeSpan(0, 0, 0, 0, (int)LDTE.Dur), + }); + count++; + if (count % decoupage == 0) + { + selectedChapter++; + if (selectedChapter >= 4) + { + selectedChapter = 3; + } + } + _videoBook.Duration = _videoBook.Duration.Add(new TimeSpan(0, 0, 0, 0, (int)LDTE.Dur)); } foreach (LDTElement LDTE in LDTAC.Content[3].Elements) diff -r 185e3ab53a56 -r 12515e11b357 client/src/Iri.Modernisation.Data/Models/PolemicElement.cs --- a/client/src/Iri.Modernisation.Data/Models/PolemicElement.cs Mon Nov 23 14:52:34 2009 +0100 +++ b/client/src/Iri.Modernisation.Data/Models/PolemicElement.cs Mon Nov 23 17:05:00 2009 +0100 @@ -21,7 +21,8 @@ Polemic=1, Adhesion, Reference, - Question + Question + }; /// diff -r 185e3ab53a56 -r 12515e11b357 client/src/Iri.Modernisation.Data/Models/VideoBook.cs --- a/client/src/Iri.Modernisation.Data/Models/VideoBook.cs Mon Nov 23 14:52:34 2009 +0100 +++ b/client/src/Iri.Modernisation.Data/Models/VideoBook.cs Mon Nov 23 17:05:00 2009 +0100 @@ -47,10 +47,10 @@ public VideoBook() { Chapters = new VideoChapter[4]; - Chapters[0] = new VideoChapter(this,"Modernisation"); - Chapters[1] = new VideoChapter(this, "Modernité"); - Chapters[2] = new VideoChapter(this, "Post-Modernité"); - Chapters[3] = new VideoChapter(this, "Ouverture"); + Chapters[0] = new VideoChapter(this,"Modernisation",VideoChapterType.Modernite); + Chapters[1] = new VideoChapter(this, "Modernité", VideoChapterType.Modernisation); + Chapters[2] = new VideoChapter(this, "Post-Modernité",VideoChapterType.Postmodernite); + Chapters[3] = new VideoChapter(this, "Ouverture",VideoChapterType.Ouverture); } diff -r 185e3ab53a56 -r 12515e11b357 client/src/Iri.Modernisation.Data/Models/VideoChapter.cs --- a/client/src/Iri.Modernisation.Data/Models/VideoChapter.cs Mon Nov 23 14:52:34 2009 +0100 +++ b/client/src/Iri.Modernisation.Data/Models/VideoChapter.cs Mon Nov 23 17:05:00 2009 +0100 @@ -11,6 +11,14 @@ using System.Collections.Generic; namespace Iri.Modernisation.Data.Models { + public enum VideoChapterType + { + Modernite=0, + Modernisation=1, + Postmodernite, + Ouverture + } + /// /// Chapitre d'un VideoLivre /// @@ -22,6 +30,11 @@ public VideoBook Book {get;set;} /// + /// Chapitre + /// + public VideoChapterType Type { get; set; } + + /// /// Titre du chapitre /// public String Title { get; set; } @@ -45,9 +58,10 @@ /// Constructeur /// /// Nom du chaptire - public VideoChapter(VideoBook fromBook,String name) + public VideoChapter(VideoBook fromBook,String name,VideoChapterType type) { Book = fromBook; + Type = type; Title = name; Index = new List(); Annotations = new List(); diff -r 185e3ab53a56 -r 12515e11b357 client/test/mainInterface/Iri.Modernisation.Test.MainInterface/MainPage.xaml.cs --- a/client/test/mainInterface/Iri.Modernisation.Test.MainInterface/MainPage.xaml.cs Mon Nov 23 14:52:34 2009 +0100 +++ b/client/test/mainInterface/Iri.Modernisation.Test.MainInterface/MainPage.xaml.cs Mon Nov 23 17:05:00 2009 +0100 @@ -43,7 +43,7 @@ temp.MediaPath = Application.Current.Host.Source.Host+@"/video.mp4"; SelectedVideoBooks.Add(temp); SelectedVideoBooks.Add(new LDTFileReader("Content/ENMI08-III_elizabethrosse-psychologie_et_reseaux_sociaux-jauffret.ldt").VideoBook); - SelectedVideoBooks.Add(new LDTFileReader("Content/ENMI08-IV-dominiquepasquier-jauffret.ldt").VideoBook); + // SelectedVideoBooks.Add(new LDTFileReader("Content/ENMI08-IV-dominiquepasquier-jauffret.ldt").VideoBook); /********************************************/ /*************** Initialisation des commandes ***************/