8 using System.Windows.Media; |
8 using System.Windows.Media; |
9 using System.Windows.Media.Animation; |
9 using System.Windows.Media.Animation; |
10 using System.Windows.Shapes; |
10 using System.Windows.Shapes; |
11 using System.Collections.Generic; |
11 using System.Collections.Generic; |
12 using System.Xml.Linq; |
12 using System.Xml.Linq; |
|
13 using Iri.Modernisation.Data.Models; |
13 namespace Iri.Modernisation.Data.LDTClass |
14 namespace Iri.Modernisation.Data.LDTClass |
14 { |
15 { |
15 /// <summary> |
16 /// <summary> |
16 /// Balise Element |
17 /// Balise Element |
17 /// </summary> |
18 /// </summary> |
61 /// Elements |
62 /// Elements |
62 /// </summary> |
63 /// </summary> |
63 public List<String> Tags { get; set; } |
64 public List<String> Tags { get; set; } |
64 |
65 |
65 /// <summary> |
66 /// <summary> |
|
67 /// Attribute |
|
68 /// </summary> |
|
69 public int Type { get; set; } |
|
70 |
|
71 /// <summary> |
66 /// Elements |
72 /// Elements |
67 /// </summary> |
73 /// </summary> |
68 public String Video { get; set; } |
74 public String Video { get; set; } |
|
75 |
|
76 public LDTElement(Annotation annotation) |
|
77 { |
|
78 Id = annotation.Id; |
|
79 Title = annotation.Title; |
|
80 Abstract = annotation.Description; |
|
81 Begin = annotation.TimerIn.TotalMilliseconds; |
|
82 Dur = annotation.TimerOut.TotalMilliseconds - annotation.TimerIn.TotalMilliseconds; |
|
83 Tags = annotation.Tags; |
|
84 Date = DateTime.Now; |
|
85 Src = String.Empty; |
|
86 Author = String.Empty; |
|
87 Audio = String.Empty; |
|
88 Video = String.Empty; |
|
89 |
|
90 Color = double.Parse(annotation.Type.Color.A.ToString() + annotation.Type.Color.R.ToString() + annotation.Type.Color.G.ToString() + annotation.Type.Color.B.ToString()); |
|
91 Type = 0; |
|
92 |
|
93 } |
69 |
94 |
70 public LDTElement(XElement e) |
95 public LDTElement(XElement e) |
71 { |
96 { |
72 Tags = new List<String>(); |
97 Tags = new List<String>(); |
73 |
98 |
74 Id = e.Attribute("id").Value; |
99 Id = e.Attribute("id").Value; |
75 Begin = Double.Parse(e.Attribute("begin").Value); |
100 Begin = Double.Parse(e.Attribute("begin").Value); |
76 Dur = Double.Parse(e.Attribute("dur").Value); |
101 Dur = Double.Parse(e.Attribute("dur").Value); |
77 Author = e.Attribute("author").Value; |
102 Author = e.Attribute("author").Value; |
78 Date = DateTime.Parse(e.Attribute("date").Value); |
103 Date = DateTime.Parse(e.Attribute("date").Value); |
79 Color = int.Parse(e.Attribute("color").Value); |
104 Color = double.Parse(e.Attribute("color").Value); |
80 Src = e.Attribute("src").Value; |
105 Src = e.Attribute("src").Value; |
81 Title = e.Element("title").Value; |
106 Title = e.Element("title").Value; |
82 Abstract = e.Element("abstract").Value; |
107 Abstract = e.Element("abstract").Value; |
83 Audio = e.Element("audio").Value; |
108 Audio = e.Element("audio").Value; |
84 if (e.Element("video")==null) |
109 if (e.Element("video")==null) |
120 new XAttribute("dur",Dur), |
154 new XAttribute("dur",Dur), |
121 new XAttribute("author",Author), |
155 new XAttribute("author",Author), |
122 new XAttribute("date",Date.ToString("")), |
156 new XAttribute("date",Date.ToString("")), |
123 new XAttribute("color",Color), |
157 new XAttribute("color",Color), |
124 new XAttribute("src",Src), |
158 new XAttribute("src",Src), |
|
159 new XAttribute("type",Type.ToString()), |
125 new XElement("title",Title), |
160 new XElement("title",Title), |
126 new XElement("abstract",Abstract), |
161 new XElement("abstract",Abstract), |
127 new XElement("audio",Audio), |
162 new XElement("audio",Audio), |
128 new XElement("video",Video) |
163 new XElement("video",Video) |
129 ); |
164 ); |