client/src/Iri.Modernisation.Data/Ldt/Readers.cs
changeset 39 0f2bde8fdfeb
parent 38 bd33267300aa
child 40 581829b5ddd9
--- a/client/src/Iri.Modernisation.Data/Ldt/Readers.cs	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/Readers.cs	Tue Feb 09 15:30:46 2010 +0100
@@ -10,6 +10,7 @@
 using System.Windows.Shapes;
 using Iri.Modernisation.Data.Models;
 using System.Xml.Linq;
+using System.Collections.Generic;
 namespace Iri.Modernisation.Data.LDTClass
 {
     public class LDTFileReader
@@ -151,28 +152,35 @@
                 }
                 chapter++;
             }
-           
+
+            Dictionary<String, String> BasicRelation = new Dictionary<string, string>();
+            foreach (LDTRelation LDTR in ldt.BasicRelations)
+            {
+                BasicRelation.Add(LDTR.IdElementTo, LDTR.Type);
+            }
+
             foreach (LDTAnnotationsContent LDTAC in ldt.Annotations)
             {
                int chapterIndex = 0;
                foreach(LDTAnnotationsDecoupage LDTAD  in LDTAC.Content)
                {
                    User author = new User() {UserName = LDTAD.Author };
-                   foreach(LDTElement elem in LDTAD.Elements)
-                   {
+                   LDTElement elem = LDTAD.Elements[0];
+                   
                        _videoBook.Chapters[chapterIndex].Annotations.Add(
                            new Annotation(_videoBook.Chapters[chapterIndex])
                            {
+                               Id = elem.Id,
                                Title = elem.Title,
                                Description = elem.Abstract,
                                Tags = elem.Tags,
                                TimerIn = new TimeSpan(0, 0, 0, 0, (int)elem.Begin),
                                Duration = new TimeSpan(0, 0, 0, 0, (int)elem.Dur),
-                               Type = FactoryVideoLivre.AnnotationDescriptions[elem.Type],
+                             Type = FactoryVideoLivre.DictionaryAnnotationDescriptions[BasicRelation[elem.Id]],
                                Contributer = author
 
                            });
-                   }
+                   
                  
                }
                chapterIndex++;