client/src/Iri.Modernisation.Data/Ldt/LDTDecoupage.cs
changeset 0 249d70e7b32d
child 34 4d9ebc6fbbe8
equal deleted inserted replaced
-1:000000000000 0:249d70e7b32d
       
     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; }
       
    24         public LDTDecoupage(){}
       
    25 
       
    26 
       
    27     }
       
    28 
       
    29     /// <summary>
       
    30     /// Classe Decoupage issue des Annotations
       
    31     /// </summary>
       
    32     public class LDTAnnotationsDecoupage : LDTDecoupage
       
    33     {
       
    34         /// <summary>
       
    35         /// Attribut
       
    36         /// </summary>
       
    37         public String Author { get; set; }
       
    38 
       
    39         /// <summary>
       
    40         /// Element
       
    41         /// </summary>
       
    42         public String Title { get; set; }
       
    43 
       
    44         /// <summary>
       
    45         /// Element
       
    46         /// </summary>
       
    47         public String Abstract { get; set; }
       
    48 
       
    49         /// <summary>
       
    50         /// Elements
       
    51         /// </summary>
       
    52         public List<LDTElement> Elements { get; set; }
       
    53 
       
    54         public LDTAnnotationsDecoupage(XElement e)
       
    55         {
       
    56             Elements = new List<LDTElement>();
       
    57             Id = e.Attribute("id").Value;
       
    58             Author = e.Attribute("author").Value;
       
    59             Title = e.Element("title").Value;
       
    60             Abstract = e.Element("abstract").Value;
       
    61 
       
    62             foreach (XElement Elem in e.Element("elements").Elements())
       
    63             {
       
    64                 Elements.Add(new LDTElement(Elem));
       
    65             }
       
    66         }
       
    67         public XElement XML
       
    68         {
       
    69             get
       
    70             {
       
    71                 XElement temp = new XElement("decoupage",
       
    72                     new XAttribute("id", Id),
       
    73                     new XAttribute("author", Author),
       
    74                     new XElement("title",Title),
       
    75                     new XElement("abstract",Abstract)
       
    76                     );
       
    77                 XElement Xelements = new XElement("elements");
       
    78                 foreach (LDTElement element in Elements)
       
    79                 {
       
    80                     Xelements.Add(element.XML);
       
    81                 }
       
    82                 temp.Add(Xelements);
       
    83                 return temp;
       
    84             }
       
    85         }
       
    86     }
       
    87 
       
    88     /// <summary>
       
    89     /// Classe Decoupage issue des Displays
       
    90     /// </summary>
       
    91     public class LDTDisplaysDecoupage : LDTDecoupage
       
    92     {
       
    93         /// <summary>
       
    94         /// Attribut
       
    95         /// </summary>
       
    96         public String IdEns { get; set; }
       
    97 
       
    98         /// <summary>
       
    99         /// Attribut
       
   100         /// </summary>
       
   101         public String TagsSelect { get; set; }
       
   102 
       
   103         public LDTDisplaysDecoupage(XElement e)
       
   104         {
       
   105             Id = e.Attribute("id").Value;
       
   106             IdEns = e.Attribute("idens").Value;
       
   107             TagsSelect = e.Attribute("tagsSelect").Value;
       
   108         }
       
   109         public XElement XML
       
   110         {
       
   111             get
       
   112             {
       
   113                 return new XElement("decoupage",
       
   114                     new XAttribute("id",Id),
       
   115                     new XAttribute("idens",IdEns),
       
   116                     new XAttribute("tagsSelect",TagsSelect)
       
   117                     );
       
   118             }
       
   119         }
       
   120     }
       
   121 }