/// <summary> /// Fill object data from xml node /// </summary> /// <param name="source">Source Xml</param> protected override void LoadFromXmlNode(XmlNode source) { this.Type = GetEnumAttribute <AdvanceNotificationGroupType>(source, "type", AdvanceNotificationGroupType.EMAIL); this.Name = GetAttribute(source, "name", null); HashSet <string> ret = new HashSet <string>(); foreach (XmlNode node in XmlReadWrite.GetChildren(source, "contact")) { ret.Add(XmlReadWrite.GetAttribute(node, "value")); } }
/// <summary> /// Query notification group /// </summary> /// <param name="type">group type</param> /// <param name="name">group name</param> /// <returns>set of contact information</returns> /// <exception cref="AdvanceIOException">if network connection failed</exception> /// <exception cref="AdvanceXMLException">On Xml parsing error</exception> /// <exception cref="AdvanceControlException">if username or password is incorrect</exception> public List <string> QueryNotificationGroup(AdvanceNotificationGroupType type, string name) { Dictionary <string, object> attrs = new Dictionary <string, object>(); attrs.Add("type", type); attrs.Add("name", name); XmlNode resp = this.communicator.Query(XmlReadWrite.CreateFunctionRequest("query-notification-group", null, attrs)); AdvanceNotificationGroup ng = XmlReadWrite.CreateFromXml <AdvanceNotificationGroup>(resp); return(ng.Contacts); }
public AdvanceNotificationGroup(AdvanceNotificationGroupType type, string name, ICollection <string> contacts) { this.Type = type; this.Name = name; this.Contacts = new List <string>(contacts); }