|
34
|
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; |
|
35
|
11 |
using System.Collections.Generic; |
|
|
12 |
using System.Xml.Linq; |
|
|
13 |
namespace Iri.Modernisation.Data.LDTClass |
|
34
|
14 |
{ |
|
|
15 |
public class IRIEnsemble |
|
|
16 |
{ |
|
35
|
17 |
//ensemble id="en_2" author="DDC - IRI" date="06/2006" display="2" title="Image" abstract="Découpage visuel" |
|
34
|
18 |
|
|
35
|
19 |
public String Id { get; set; } |
|
|
20 |
public String Author { get; set; } |
|
|
21 |
public DateTime Date { get; set; } |
|
|
22 |
public int Display { get; set; } |
|
|
23 |
public String Title { get; set; } |
|
|
24 |
public String Abstract { get; set; } |
|
|
25 |
public List<IRIDecoupage> Decoupages { get; set; } |
|
|
26 |
|
|
|
27 |
public IRIEnsemble() |
|
|
28 |
{ |
|
38
|
29 |
Id = System.Guid.NewGuid().ToString(); |
|
35
|
30 |
Author = String.Empty; |
|
|
31 |
Date = DateTime.Now; |
|
|
32 |
Display = 0; |
|
|
33 |
Title = String.Empty; |
|
|
34 |
Abstract = String.Empty; |
|
|
35 |
Decoupages = new List<IRIDecoupage>(); |
|
|
36 |
} |
|
|
37 |
|
|
|
38 |
public IRIEnsemble(XElement elem) |
|
|
39 |
{ |
|
|
40 |
Id = elem.Attribute("id").Value; |
|
|
41 |
Author = elem.Attribute("author").Value; |
|
|
42 |
Date = DateTime.Parse(elem.Attribute("date").Value); |
|
|
43 |
Display = int.Parse(elem.Attribute("display").Value); |
|
|
44 |
Title = elem.Attribute("title").Value; |
|
|
45 |
Abstract = elem.Attribute("abstract").Value; |
|
38
|
46 |
Decoupages = new List<IRIDecoupage>(); |
|
|
47 |
foreach (XElement XDecoupage in elem.Elements("decoupage")) |
|
35
|
48 |
{ |
|
|
49 |
Decoupages.Add(new IRIDecoupage(XDecoupage)); |
|
|
50 |
} |
|
|
51 |
} |
|
|
52 |
public XElement XML |
|
|
53 |
{ |
|
|
54 |
get |
|
|
55 |
{ |
|
|
56 |
XElement temp = new XElement("ensemble", |
|
|
57 |
new XAttribute("id",Id), |
|
|
58 |
new XAttribute("author",Author), |
|
|
59 |
new XAttribute("date", Date.ToString("dd/MM/yyyy")), |
|
|
60 |
new XAttribute("display",Display), |
|
|
61 |
new XAttribute("title",Title), |
|
|
62 |
new XAttribute("abstract",Abstract)); |
|
|
63 |
foreach (IRIDecoupage decoupage in Decoupages) |
|
|
64 |
{ |
|
|
65 |
temp.Add(decoupage.XML); |
|
|
66 |
} |
|
|
67 |
return temp; |
|
|
68 |
|
|
|
69 |
} |
|
|
70 |
} |
|
34
|
71 |
} |
|
|
72 |
} |