/// <summary> /// /// </summary> /// <param name="doc"></param> /// <returns></returns> public static XElement SaveToXML(this HisSettingDoc doc) { XElement xe = new XElement("HisSetting"); xe.SetAttributeValue("FileDataDuration", doc.FileDataDuration); xe.SetAttributeValue("DataBlockDuration", doc.DataBlockDuration); return(xe); }
/// <summary> /// /// </summary> /// <param name="element"></param> /// <returns></returns> public static HisSettingDoc LoadHisSettingDocFromXML(this XElement element) { HisSettingDoc re = new HisSettingDoc(); if (element.Attribute("FileDataDuration") != null) { re.FileDataDuration = int.Parse(element.Attribute("FileDataDuration").Value); } if (element.Attribute("DataBlockDuration") != null) { re.DataBlockDuration = int.Parse(element.Attribute("DataBlockDuration").Value); } return(re); }
/// <summary> /// /// </summary> /// <param name="doc"></param> /// <returns></returns> public static XElement SaveToXML(this HisSettingDoc doc) { XElement xe = new XElement("HisSetting"); xe.SetAttributeValue("FileDataDuration", doc.FileDataDuration); xe.SetAttributeValue("DataBlockDuration", doc.DataBlockDuration); if (!string.IsNullOrEmpty(doc.HisDataPathPrimary)) { xe.SetAttributeValue("HisDataPathPrimary", doc.HisDataPathPrimary); } if (!string.IsNullOrEmpty(doc.HisDataPathBack)) { xe.SetAttributeValue("HisDataPathBack", doc.HisDataPathBack); } xe.SetAttributeValue("HisDataKeepTimeInPrimaryPath", doc.HisDataKeepTimeInPrimaryPath); xe.SetAttributeValue("KeepNoZipFileDays", doc.KeepNoZipFileDays); return(xe); }
/// <summary> /// /// </summary> /// <param name="element"></param> /// <returns></returns> public static HisSettingDoc LoadHisSettingDocFromXML(this XElement element) { HisSettingDoc re = new HisSettingDoc(); if (element.Attribute("FileDataDuration") != null) { re.FileDataDuration = int.Parse(element.Attribute("FileDataDuration").Value); } if (element.Attribute("DataBlockDuration") != null) { re.DataBlockDuration = int.Parse(element.Attribute("DataBlockDuration").Value); } if (element.Attribute("HisDataPathPrimary") != null) { re.HisDataPathPrimary = element.Attribute("HisDataPathPrimary").Value; } if (element.Attribute("HisDataPathBack") != null) { re.HisDataPathBack = element.Attribute("HisDataPathBack").Value; } if (element.Attribute("HisDataKeepTimeInPrimaryPath") != null) { re.HisDataKeepTimeInPrimaryPath = int.Parse(element.Attribute("HisDataKeepTimeInPrimaryPath").Value); } if (element.Attribute("KeepNoZipFileDays") != null) { re.KeepNoZipFileDays = int.Parse(element.Attribute("KeepNoZipFileDays").Value); } return(re); }
/// <summary> /// /// </summary> public HisDatabase() { Setting = new HisSettingDoc(); }