/// <summary> /// Set data /// </summary> /// <param name="value">Source value</param> protected virtual void SetData(NtClassificationItem value) { this.Connection = value.Connection; this.ID = value.ID; this.Name = (string)value.Name.Clone(); this.DisplayName = (string)value.DisplayName.Clone(); this.Changed = value.Changed; }
public object Clone() { NtClassificationItem item = new NtClassificationItem(); item.SetData(this); return item; }
/// <summary> /// Removes specified Classifier Item /// </summary> /// <param name="item">Classifier item</param> public void RemoveClassificationItem(NtClassificationItem item) { RemoveClassificationItem(item.ID); }
/// <summary> /// Deserialize from XML node /// </summary> /// <param name="node">XML node</param> public override void Deserialize(System.Xml.XmlNode node) { Clear(); if (node == null) throw new ArgumentNullException(); if (node.Name != "classifier") throw new Exception(GetType().ToString() + ".Deserialize(), Invalid XML item:\n" + node.OuterXml); foreach (XmlAttribute attr in node.Attributes) { if (attr.Name.CompareTo("id") == 0) ID = HelperXML.GetGuid(attr.Value); else if (attr.Name.CompareTo("name") == 0) Name = attr.Value; else if (attr.Name.CompareTo("displayName") == 0) DisplayName = attr.Value; } foreach (XmlNode nodeChild in node.ChildNodes) { if (nodeChild.Name == "classification-item") { NtClassificationItem item = new NtClassificationItem(); item.Connection = Connection; item.Deserialize(nodeChild); Items.Add(item); } } Changed = false; IsNew = false; }
/// <summary> /// Adds Classification Items /// </summary> /// <param name="item">Classifier Item ID</param> public void AddClassificationItem(NtClassificationItem item) { AddClassificationItem(item.ID); }