|
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 |
/// Classe Abstraite de Base pour la balise Découpage |
|
|
17 |
/// </summary> |
|
|
18 |
public abstract class LDTDecoupage |
|
|
19 |
{ |
|
|
20 |
/// <summary> |
|
|
21 |
/// Attribut |
|
|
22 |
/// </summary> |
|
|
23 |
public String Id { get; set; } |
|
39
|
24 |
public LDTDecoupage(){ |
|
|
25 |
Id = System.Guid.NewGuid().ToString(); |
|
|
26 |
} |
|
0
|
27 |
|
|
|
28 |
|
|
|
29 |
} |
|
|
30 |
|
|
|
31 |
/// <summary> |
|
|
32 |
/// Classe Decoupage issue des Annotations |
|
|
33 |
/// </summary> |
|
|
34 |
public class LDTAnnotationsDecoupage : LDTDecoupage |
|
|
35 |
{ |
|
|
36 |
/// <summary> |
|
|
37 |
/// Attribut |
|
|
38 |
/// </summary> |
|
|
39 |
public String Author { get; set; } |
|
|
40 |
|
|
|
41 |
/// <summary> |
|
|
42 |
/// Element |
|
|
43 |
/// </summary> |
|
|
44 |
public String Title { get; set; } |
|
|
45 |
|
|
|
46 |
/// <summary> |
|
|
47 |
/// Element |
|
|
48 |
/// </summary> |
|
|
49 |
public String Abstract { get; set; } |
|
|
50 |
|
|
|
51 |
/// <summary> |
|
|
52 |
/// Elements |
|
|
53 |
/// </summary> |
|
|
54 |
public List<LDTElement> Elements { get; set; } |
|
|
55 |
|
|
|
56 |
public LDTAnnotationsDecoupage(XElement e) |
|
|
57 |
{ |
|
|
58 |
Elements = new List<LDTElement>(); |
|
|
59 |
Id = e.Attribute("id").Value; |
|
|
60 |
Author = e.Attribute("author").Value; |
|
|
61 |
Title = e.Element("title").Value; |
|
|
62 |
Abstract = e.Element("abstract").Value; |
|
|
63 |
|
|
|
64 |
foreach (XElement Elem in e.Element("elements").Elements()) |
|
|
65 |
{ |
|
|
66 |
Elements.Add(new LDTElement(Elem)); |
|
|
67 |
} |
|
|
68 |
} |
|
34
|
69 |
public LDTAnnotationsDecoupage() |
|
|
70 |
{ |
|
38
|
71 |
Id = System.Guid.NewGuid().ToString(); |
|
34
|
72 |
Author = String.Empty; |
|
|
73 |
Title = String.Empty; |
|
|
74 |
Abstract = String.Empty; |
|
|
75 |
Elements = new List<LDTElement>(); |
|
|
76 |
} |
|
0
|
77 |
public XElement XML |
|
|
78 |
{ |
|
|
79 |
get |
|
|
80 |
{ |
|
|
81 |
XElement temp = new XElement("decoupage", |
|
|
82 |
new XAttribute("id", Id), |
|
|
83 |
new XAttribute("author", Author), |
|
|
84 |
new XElement("title",Title), |
|
|
85 |
new XElement("abstract",Abstract) |
|
|
86 |
); |
|
|
87 |
XElement Xelements = new XElement("elements"); |
|
|
88 |
foreach (LDTElement element in Elements) |
|
|
89 |
{ |
|
|
90 |
Xelements.Add(element.XML); |
|
|
91 |
} |
|
|
92 |
temp.Add(Xelements); |
|
|
93 |
return temp; |
|
|
94 |
} |
|
|
95 |
} |
|
|
96 |
} |
|
|
97 |
|
|
|
98 |
/// <summary> |
|
|
99 |
/// Classe Decoupage issue des Displays |
|
|
100 |
/// </summary> |
|
|
101 |
public class LDTDisplaysDecoupage : LDTDecoupage |
|
|
102 |
{ |
|
|
103 |
/// <summary> |
|
|
104 |
/// Attribut |
|
|
105 |
/// </summary> |
|
|
106 |
public String IdEns { get; set; } |
|
|
107 |
|
|
|
108 |
/// <summary> |
|
|
109 |
/// Attribut |
|
|
110 |
/// </summary> |
|
|
111 |
public String TagsSelect { get; set; } |
|
|
112 |
|
|
|
113 |
public LDTDisplaysDecoupage(XElement e) |
|
|
114 |
{ |
|
|
115 |
Id = e.Attribute("id").Value; |
|
|
116 |
IdEns = e.Attribute("idens").Value; |
|
|
117 |
TagsSelect = e.Attribute("tagsSelect").Value; |
|
|
118 |
} |
|
|
119 |
public XElement XML |
|
|
120 |
{ |
|
|
121 |
get |
|
|
122 |
{ |
|
|
123 |
return new XElement("decoupage", |
|
|
124 |
new XAttribute("id",Id), |
|
|
125 |
new XAttribute("idens",IdEns), |
|
|
126 |
new XAttribute("tagsSelect",TagsSelect) |
|
|
127 |
); |
|
|
128 |
} |
|
|
129 |
} |
|
|
130 |
} |
|
|
131 |
} |