|
0
|
1 |
using System; |
|
|
2 |
using System.Net; |
|
|
3 |
using System.Windows; |
|
|
4 |
using System.Windows.Controls; |
|
|
5 |
using System.Windows.Documents; |
|
|
6 |
using System.Windows.Ink; |
|
|
7 |
using System.Windows.Input; |
|
|
8 |
using System.Windows.Media; |
|
|
9 |
using System.Windows.Media.Animation; |
|
|
10 |
using System.Windows.Shapes; |
|
|
11 |
using System.Collections.Generic; |
|
|
12 |
using System.Xml.Linq; |
|
|
13 |
namespace Iri.Modernisation.Data.LDTClass |
|
|
14 |
{ |
|
|
15 |
/// <summary> |
|
|
16 |
/// Balise Edit |
|
|
17 |
/// </summary> |
|
|
18 |
public class LDTEdit |
|
|
19 |
{ |
|
|
20 |
/// <summary> |
|
|
21 |
/// Attribut |
|
|
22 |
/// </summary> |
|
|
23 |
public String Id { get; set; } |
|
|
24 |
/// <summary> |
|
|
25 |
/// Attribut |
|
|
26 |
/// </summary> |
|
|
27 |
public String Tags { get; set; } |
|
|
28 |
/// <summary> |
|
|
29 |
/// Elements |
|
|
30 |
/// </summary> |
|
|
31 |
public List<LDTInst> eList { get; set; } |
|
|
32 |
/// <summary> |
|
|
33 |
/// Element |
|
|
34 |
/// </summary> |
|
|
35 |
public String Caption { get; set; } |
|
|
36 |
/// <summary> |
|
|
37 |
/// Element |
|
|
38 |
/// </summary> |
|
|
39 |
public String Audio { get; set; } |
|
|
40 |
/// <summary> |
|
|
41 |
/// Elements |
|
|
42 |
/// </summary> |
|
|
43 |
public List<LDTm> mList { get; set; } |
|
|
44 |
public LDTEdit(XElement e) |
|
|
45 |
{ |
|
|
46 |
eList = new List<LDTInst>(); |
|
|
47 |
mList = new List<LDTm>(); |
|
|
48 |
|
|
|
49 |
Id = e.Attribute("id").Value; |
|
|
50 |
Tags = e.Attribute("tags").Value; |
|
|
51 |
foreach (XElement Elem in e.Element("eList").Elements()) |
|
|
52 |
{ |
|
|
53 |
eList.Add(new LDTInst(Elem)); |
|
|
54 |
} |
|
|
55 |
|
|
|
56 |
Caption = e.Element("caption").Value; |
|
|
57 |
Audio = e.Element("audio").Value; |
|
|
58 |
|
|
|
59 |
foreach (XElement Elem in e.Element("mList").Elements()) |
|
|
60 |
{ |
|
|
61 |
mList.Add(new LDTm(Elem)); |
|
|
62 |
} |
|
|
63 |
} |
|
|
64 |
public XElement XML |
|
|
65 |
{ |
|
|
66 |
get |
|
|
67 |
{ |
|
|
68 |
XElement temp = new XElement("edit", |
|
|
69 |
new XAttribute("id",Id), |
|
|
70 |
new XAttribute("tags",Tags) |
|
|
71 |
); |
|
|
72 |
/* Ajout de eList */ |
|
|
73 |
XElement XeList = new XElement("eList"); |
|
|
74 |
foreach (LDTInst inst in eList) |
|
|
75 |
{ |
|
|
76 |
XeList.Add(inst.XML); |
|
|
77 |
} |
|
|
78 |
temp.Add(XeList); |
|
|
79 |
|
|
|
80 |
temp.Add(new XElement("caption",Caption)); |
|
|
81 |
temp.Add(new XElement("audio",Audio)); |
|
|
82 |
|
|
|
83 |
/* Ajout de mList */ |
|
|
84 |
XElement XmList = new XElement("mList"); |
|
|
85 |
foreach(LDTm m in mList) |
|
|
86 |
{ |
|
|
87 |
XmList.Add(m.XML); |
|
|
88 |
} |
|
|
89 |
temp.Add(XmList); |
|
|
90 |
|
|
|
91 |
return temp; |
|
|
92 |
|
|
|
93 |
} |
|
|
94 |
} |
|
|
95 |
} |
|
|
96 |
} |