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 { public class DeliveryDefinition : XmlLinqBase { #region Built'in classes #region ElementNames class /// /// Az XML fájlban ilyen elem nevek találhatóak egy "DeliveryDefinition" elemben. /// public new class ElementNames : XmlLinqBase.ElementNames { /// /// 'ConnectionStringName' elem név. /// public const string CONNECTIONSTRINGNAME = "ConnectionStringName"; /// /// 'SendAs' elem név. /// public const string SENDAS = "SendAs"; /// /// 'SendCopyTo' elem név. /// public const string SENDCOPYTO = "SendCopyTo"; } #endregion ElementNames class #region AttributeNames static class /// /// Az XML fájlban ilyen attribútum nevek találhatóak egy "DeliveryDefinition" elemben. /// public static class AttributeNames { /// /// 'Name' attribútum név. /// public const string NAME = "Name"; } #endregion AttributeNames static class #endregion Built'in classes #region Properties /// /// A szállítási definíció neve. /// public string Name { get; set; } /// /// A kapcsolati sztring neve. /// public string ConnectionStringName { get; set; } /// /// A feladó email címe. /// public string SendAs { get; set; } /// /// A másolatot kapók vesszővel elválasztott email cím listája. /// public string SendCopyTo { get; set; } #endregion Properties #region Constructor /// /// Példányosítás egy XElement alapján. /// Ha paraméter null, akkor nem történik értékadás /// de a példány létrejön. /// /// Egy "DeliveryDefinition" element objektum. public DeliveryDefinition(XElement xelement) { if (xelement != null) { this.Name = GetValue(AttributeNames.NAME, xelement, "", true, true); this.ConnectionStringName = GetValue(xelement.Element(ElementNames.CONNECTIONSTRINGNAME), "", true, true); this.SendAs = GetValue(xelement.Element(ElementNames.SENDAS), ""); this.SendCopyTo = GetValue(xelement.Element(ElementNames.SENDCOPYTO), ""); } } #endregion Constructor } }