AttachmentElement.cs
2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using Vrh.XmlProcessing;
namespace Vrh.OneMessage
{
/// <summary>
/// A "attachment" elem leképezése.
/// </summary>
public class AttachmentElement : XmlLinqBase
{
#region Built'in classes
#region AttributeNames static class
/// <summary>
/// XML fájlokban ilyen attribútum nevek találhatóak egy DeliveryDefinition elemben.
/// </summary>
public static class AttributeNames
{
/// <summary>
/// 'folder' attribútum név.
/// </summary>
public const string FOLDER = "Folder";
/// <summary>
/// 'file' attribútum név.
/// </summary>
public const string FILE = "File";
}
#endregion AttributeNames static class
#endregion Built'in classes
#region Properties
/// <summary>
/// A csatolmány mappája.
/// </summary>
public string Folder { get; set; }
/// <summary>
/// A csatolmány fájl neve.
/// </summary>
public string File { get; set; }
#endregion Properties
#region Constructor
/// <summary>
/// Példányosítás egy XElement alapján.
/// Ha <paramref name="xelement"/> paraméter null, akkor nem történik értékadás
/// de a példány létrejön.
/// </summary>
/// <param name="xelement">Egy "attachment" element objektum.</param>
/// <param name="defaultFolder">Az alapértelmezett mappa neve.</param>
public AttachmentElement(XElement xelement, string defaultFolder = null)
{
if (xelement != null)
{
this.Folder = GetValue(AttributeNames.FOLDER, xelement, defaultFolder??"");
this.File = GetValue(AttributeNames.FILE, xelement, "");
}
}
#endregion Constructor
}
}