/// <summary> /// Загрузить конфигурацию компонента из XML-узла /// </summary> public override void LoadFromXml(XmlNode xmlNode) { base.LoadFromXml(xmlNode); BackColorOnHover = xmlNode.GetChildAsString("BackColorOnHover"); BorderColorOnHover = xmlNode.GetChildAsString("BorderColorOnHover"); ForeColorOnHover = xmlNode.GetChildAsString("ForeColorOnHover"); UnderlineOnHover = xmlNode.GetChildAsBool("UnderlineOnHover"); PopupSize = PopupSize.GetChildAsSize(xmlNode, "PopupSize"); Target = xmlNode.GetChildAsEnum <LinkTarget>("Target"); Url = xmlNode.GetChildAsString("Url"); ViewID = xmlNode.GetChildAsInt("ViewID"); }
/// <summary> /// Сохранить конфигурацию компонента в XML-узле /// </summary> public override void SaveToXml(XmlElement xmlElem) { base.SaveToXml(xmlElem); xmlElem.AppendElem("BackColorOnHover", BackColorOnHover); xmlElem.AppendElem("BorderColorOnHover", BorderColorOnHover); xmlElem.AppendElem("ForeColorOnHover", ForeColorOnHover); xmlElem.AppendElem("UnderlineOnHover", UnderlineOnHover); PopupSize.AppendElem(xmlElem, "PopupSize", PopupSize); xmlElem.AppendElem("Target", Target); xmlElem.AppendElem("Url", Url); xmlElem.AppendElem("ViewID", ViewID); }
/// <summary> /// Сохранить конфигурацию компонента в XML-узле /// </summary> public override void SaveToXml(XmlElement xmlElem) { base.SaveToXml(xmlElem); xmlElem.AppendElem("BackColorOnHover", BackColorOnHover); xmlElem.AppendElem("BorderColorOnHover", BorderColorOnHover); xmlElem.AppendElem("ForeColorOnHover", ForeColorOnHover); xmlElem.AppendElem("UnderlineOnHover", UnderlineOnHover); xmlElem.AppendElem("CnlNums", ScadaUtils.IntCollectionToStr(CnlNums)); PopupSize.AppendElem(xmlElem, "PopupSize", PopupSize); xmlElem.AppendElem("Target", Target); xmlElem.AppendElem("Url", Url); xmlElem.AppendElem("ViewID", ViewID); }
/// <summary> /// Загрузить конфигурацию компонента из XML-узла /// </summary> public override void LoadFromXml(XmlNode xmlNode) { base.LoadFromXml(xmlNode); BackColorOnHover = xmlNode.GetChildAsString("BackColorOnHover"); BorderColorOnHover = xmlNode.GetChildAsString("BorderColorOnHover"); ForeColorOnHover = xmlNode.GetChildAsString("ForeColorOnHover"); UnderlineOnHover = xmlNode.GetChildAsBool("UnderlineOnHover"); CnlNums.Clear(); CnlNums.AddRange(ScadaUtils.ParseIntArray(xmlNode.GetChildAsString("CnlNums"))); PopupSize = PopupSize.GetChildAsSize(xmlNode, "PopupSize"); Target = xmlNode.GetChildAsEnum <LinkTarget>("Target"); Url = xmlNode.GetChildAsString("Url"); ViewID = xmlNode.GetChildAsInt("ViewID"); }
/// <summary> /// Создать и добавить XML-элемент размера /// </summary> public static XmlElement AppendElem(XmlElement parentXmlElem, string elemName, PopupSize popupSize) { XmlElement xmlElem = parentXmlElem.OwnerDocument.CreateElement(elemName); xmlElem.AppendElem("Width", popupSize.Width); xmlElem.AppendElem("Height", popupSize.Height); return((XmlElement)parentXmlElem.AppendChild(xmlElem)); }