public XElement UnloadXml() { XElement checkerXml = this.checkerExternal.UnloadXml(); checkerXml.SetAttributeValue( Constant.Xml.BlockType.MethodAttribute, Constant.Xml.BlockType.MethodAttributeChecker ); XElement generatorXml = this.generatorExternal.UnloadXml(); generatorXml.SetAttributeValue( Constant.Xml.BlockType.MethodAttribute, Constant.Xml.BlockType.MethodAttributeGenerator ); Alist.Xml.Tag tag = new Alist.Xml.Tag( name: this.NameXml, value: null, child: new List <XElement> { checkerXml, generatorXml } ); XElement result = tag.UnloadXml(); result.SetAttributeValue( Constant.Xml.BlockType.IdAttribute, this.Id.ToString() ); return(result); }
public bool LoadXml(System.Xml.Linq.XElement element) { Alist.Xml.Tag tag = new Alist.Xml.Tag(); tag.LoadXml(element); string value = tag.Value; List <string> tmp = value.Split(';').ToList(); this.coordinate = tmp.ConvertAll <int>(Convert.ToInt32); return(true); }
public System.Xml.Linq.XElement UnloadXml() { List <string> value = this.coordinate.ConvertAll <string>(Convert.ToString); string valueStr = Method.ArrayToString <string>(value, ";"); Alist.Xml.Tag tag = new Alist.Xml.Tag( name: this.NameXml, value: valueStr); return(tag.UnloadXml()); }
public bool LoadXml(XElement element) { Alist.Xml.Tag tag = new Alist.Xml.Tag(); tag.LoadXml(element); if (this.checkerExternal == null) { this.checkerExternal = (new ExternalMethod(null)); } if (this.generatorExternal == null) { this.generatorExternal = (new ExternalMethod(null)); } List <XElement> method = tag.GetChildren (this.checkerExternal.NameXml); method.AddRange(tag.GetChildren (this.generatorExternal.NameXml)); for (int i = 0; i < method.Count; i++) { Alist.Xml.Tag methodTag = new Alist.Xml.Tag(); methodTag.LoadXml(method[i]); string attribute = methodTag.GetAttribute (Constant.Xml.BlockType.MethodAttribute); if (attribute.ToLower() == Constant.Xml.BlockType.MethodAttributeChecker) { this.checkerExternal.LoadXml(method[i]); } if (attribute.ToLower() == Constant.Xml.BlockType.MethodAttributeGenerator) { this.generatorExternal.LoadXml(method[i]); } } this.Id = new Adress (tag.GetAttribute(Constant.Xml.BlockType.IdAttribute)); return(true); }