--- a/client/src/Iri.Modernisation.Data/Ldt/IRIEnsemble.cs Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/IRIEnsemble.cs Mon Jan 25 09:30:22 2010 +0100
@@ -8,11 +8,64 @@
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
-
-namespace Iri.Modernisation.Data.Ldt
+using System.Collections.Generic;
+using System.Xml.Linq;
+namespace Iri.Modernisation.Data.LDTClass
{
public class IRIEnsemble
{
+ //ensemble id="en_2" author="DDC - IRI" date="06/2006" display="2" title="Image" abstract="Découpage visuel"
+ public String Id { get; set; }
+ public String Author { get; set; }
+ public DateTime Date { get; set; }
+ public int Display { get; set; }
+ public String Title { get; set; }
+ public String Abstract { get; set; }
+ public List<IRIDecoupage> Decoupages { get; set; }
+
+ public IRIEnsemble()
+ {
+ Id = String.Empty;
+ Author = String.Empty;
+ Date = DateTime.Now;
+ Display = 0;
+ Title = String.Empty;
+ Abstract = String.Empty;
+ Decoupages = new List<IRIDecoupage>();
+ }
+
+ public IRIEnsemble(XElement elem)
+ {
+ Id = elem.Attribute("id").Value;
+ Author = elem.Attribute("author").Value;
+ Date = DateTime.Parse(elem.Attribute("date").Value);
+ Display = int.Parse(elem.Attribute("display").Value);
+ Title = elem.Attribute("title").Value;
+ Abstract = elem.Attribute("abstract").Value;
+ foreach (XElement XDecoupage in elem.Element("decoupages").Elements())
+ {
+ Decoupages.Add(new IRIDecoupage(XDecoupage));
+ }
+ }
+ public XElement XML
+ {
+ get
+ {
+ XElement temp = new XElement("ensemble",
+ new XAttribute("id",Id),
+ new XAttribute("author",Author),
+ new XAttribute("date", Date.ToString("dd/MM/yyyy")),
+ new XAttribute("display",Display),
+ new XAttribute("title",Title),
+ new XAttribute("abstract",Abstract));
+ foreach (IRIDecoupage decoupage in Decoupages)
+ {
+ temp.Add(decoupage.XML);
+ }
+ return temp;
+
+ }
+ }
}
}