private void createNodes() { root.RemoveAll(); XmlElement xmlElement = xmlDocument.CreateElement("Interval"); xmlElement.InnerText = Interval.ToString(); root.AppendChild(xmlElement); XmlElement xmlElement2 = xmlDocument.CreateElement("PreScanTime"); xmlElement2.InnerText = preScanTime.ToString(); root.AppendChild(xmlElement2); XmlElement xmlElement3 = xmlDocument.CreateElement("PreScanPower"); xmlElement3.InnerText = preScanPower.ToString(); root.AppendChild(xmlElement3); XmlElement xmlElement4 = xmlDocument.CreateElement("ScanTime"); xmlElement4.InnerText = ScanTime.ToString(); root.AppendChild(xmlElement4); XmlElement xmlElement5 = xmlDocument.CreateElement("ScanPower"); xmlElement5.InnerText = scanPower.ToString(); root.AppendChild(xmlElement5); XmlElement xmlElement6 = xmlDocument.CreateElement("Layers"); xmlElement6.InnerText = "[{\"AntennaNO\":1,\"LayerNO\":1},{\"AntennaNO\":1,\"LayerNO\":2},{\"AntennaNO\":1,\"LayerNO\":3},{\"AntennaNO\":1,\"LayerNO\":4}]"; root.AppendChild(xmlElement6); XmlElement xmlElement7 = xmlDocument.CreateElement("PowerMapping"); xmlElement7.InnerText = "[{\"Power\":9,\"Min\":0,\"Max\":0},{\"Power\":11,\"Min\":1,\"Max\":5},{\"Power\":13,\"Min\":6,\"Max\":10},{\"Power\":15,\"Min\":11,\"Max\":15},{\"Power\":17,\"Min\":16,\"Max\":20},{\"Power\":19,\"Min\":21,\"Max\":25},{\"Power\":20,\"Min\":26,\"Max\":30},{\"Power\":21,\"Min\":31,\"Max\":35},{\"Power\":22,\"Min\":36,\"Max\":40},{\"Power\":23,\"Min\":41,\"Max\":45},{\"Power\":24,\"Min\":45,\"Max\":50},{\"Power\":25,\"Min\":51,\"Max\":55},{\"Power\":25,\"Min\":56,\"Max\":0}]"; root.AppendChild(xmlElement7); xmlDocument.Save(filename); }
public XElement ToXml() { XElement ele = new XElement("sample"); XElement name = new XElement("name") { Value = Name }; XElement md5 = new XElement("md5") { Value = Md5Hash }; XElement sha1 = new XElement("sha1") { Value = Sha1Hash }; XElement sha256 = new XElement("sha256") { Value = Sha256Hash }; XElement scanTime = new XElement("scanned") { Value = ScanTime.ToString("O") }; ele.Add(name); ele.Add(md5); ele.Add(sha1); ele.Add(sha256); ele.Add(scanTime); return(ele); }
public ScannedItemVM(ScannedSignature scannedSignature) { Name = scannedSignature.Name; Type = scannedSignature.Type; Group = scannedSignature.Group; ScanTime = scannedSignature.ScanTime; ScanTimeStr = ScanTime.ToString("yyyy-MM-dd HH:mm"); }