|
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; |
|
|
11 |
using System.Xml.Linq; |
|
|
12 |
namespace Iri.Modernisation.Data.LDTClass |
|
|
13 |
{ |
|
|
14 |
|
|
|
15 |
public class LDTRelation |
|
|
16 |
{ |
|
|
17 |
public String IdElementFrom { get; set; } |
|
|
18 |
public String IdElementTo { get; set; } |
|
|
19 |
public String Title { get; set; } |
|
39
|
20 |
public String Type { get; set; } |
|
34
|
21 |
public LDTRelation() |
|
|
22 |
{ |
|
|
23 |
IdElementFrom = String.Empty; |
|
|
24 |
IdElementTo = String.Empty; |
|
|
25 |
Title = String.Empty; |
|
39
|
26 |
Type = String.Empty; |
|
34
|
27 |
} |
|
|
28 |
public LDTRelation(XElement elem) |
|
|
29 |
{ |
|
|
30 |
|
|
|
31 |
|
|
|
32 |
IdElementFrom = elem.Attribute("idElementFrom").Value; |
|
|
33 |
IdElementTo = elem.Attribute("idElementTo").Value; |
|
|
34 |
Title = elem.Attribute("title").Value; |
|
39
|
35 |
Type = elem.Attribute("type").Value; |
|
34
|
36 |
} |
|
|
37 |
|
|
|
38 |
public XElement XML |
|
|
39 |
{ |
|
|
40 |
get |
|
|
41 |
{ |
|
|
42 |
if(IdElementFrom==null) |
|
|
43 |
{ |
|
|
44 |
IdElementFrom = String.Empty; |
|
|
45 |
} |
|
|
46 |
if(IdElementTo == null) |
|
|
47 |
{ |
|
|
48 |
IdElementTo = String.Empty; |
|
|
49 |
} |
|
|
50 |
if(Title == null) |
|
|
51 |
{ |
|
|
52 |
Title = String.Empty; |
|
|
53 |
} |
|
39
|
54 |
if(Type == null) |
|
|
55 |
{ |
|
|
56 |
Type = String.Empty; |
|
|
57 |
} |
|
34
|
58 |
return new XElement("relation", |
|
|
59 |
new XAttribute("idElementFrom", IdElementFrom), |
|
|
60 |
new XAttribute("idElementTo", IdElementTo), |
|
39
|
61 |
new XAttribute("title", Title), |
|
|
62 |
new XAttribute("type",Type) |
|
34
|
63 |
); |
|
|
64 |
} |
|
|
65 |
} |
|
|
66 |
|
|
|
67 |
|
|
|
68 |
} |
|
|
69 |
} |