override public void saveXML(SVXml xml) { XmlElement analog = xml.createNode(this.GetType().Name); analog.SetAttribute("ID", _attrib.ID.ToString()); analog.SetAttribute("X", _attrib.Rect.X.ToString()); analog.SetAttribute("Y", _attrib.Rect.Y.ToString()); analog.SetAttribute("Width", _attrib.Rect.Width.ToString()); analog.SetAttribute("Height", _attrib.Rect.Height.ToString()); analog.SetAttribute("Variable", _attrib.Variable.VarName); analog.SetAttribute("VariableType", _attrib.Variable.VarBlockType.ToString()); analog.SetAttribute("NormalColor", _attrib.NormalColor.ToArgb().ToString()); analog.SetAttribute("OverMaxColor", _attrib.OverMaxColor.ToArgb().ToString()); analog.SetAttribute("OverMinColor", _attrib.OverMinColor.ToArgb().ToString()); analog.SetAttribute("NormalBackcolor", _attrib.NormalBgColor.ToArgb().ToString()); analog.SetAttribute("OverMaxBgColor", _attrib.OverMaxBgColor.ToArgb().ToString()); analog.SetAttribute("OverMinBgColor", _attrib.OverMinBgColor.ToArgb().ToString()); analog.SetAttribute("ExceptionColor", _attrib.ExceptionColor.ToArgb().ToString()); analog.SetAttribute("ExceptionBgColor", _attrib.ExceptionBgColor.ToArgb().ToString()); analog.SetAttribute("DecNumber", _attrib.DecNum.ToString()); analog.SetAttribute("IsExponent", _attrib.IsExponent.ToString()); analog.SetAttribute("Font", _attrib.Font.Name.ToString()); analog.SetAttribute("FontSize", _attrib.Font.Size.ToString()); analog.SetAttribute("Max", _attrib.Max.ToString()); analog.SetAttribute("Min", _attrib.Min.ToString()); }
public void saveXML(SVXml xml) { //保存后修改状态。 IsModify = false; xml.setAttr("ID", _attrib.id.ToString()); XmlElement width = xml.createNode("Width"); width.InnerText = _attrib.Width.ToString(); XmlElement height = xml.createNode("Height"); height.InnerText = _attrib.Height.ToString(); XmlElement back = xml.createNode("Backcolor"); back.InnerText = _attrib.BackColor.ToArgb().ToString(); XmlElement mainPage = xml.createNode("MainPage"); mainPage.InnerText = _attrib.IsMainPage.ToString(); XmlElement backGroundType = xml.createNode("BackGroundType"); backGroundType.InnerText = _attrib.BackGroundType.ToString(); XmlElement picShowName = xml.createNode("PicShowName"); picShowName.InnerText = _attrib.PicIconData.ShowName; XmlElement picFile = xml.createNode("PicFile"); picFile.InnerText = _attrib.PicIconData.ImageFileName; XmlElement alignMent = xml.createNode("alignment"); alignMent.InnerText = _attrib.IsAlignment.ToString(); //保存当前页面的所有子控件 foreach (Control ctrl in this.Controls) { SVPanel svPanel = ctrl as SVPanel; if (svPanel == null) { continue; } svPanel.saveXML(xml); } }
override public void saveXML(SVXml xml) { XmlElement icon = xml.createNode(this.GetType().Name); icon.SetAttribute("ID", _attrib.ID.ToString()); icon.SetAttribute("X", _attrib.Rect.X.ToString()); icon.SetAttribute("Y", _attrib.Rect.Y.ToString()); icon.SetAttribute("Width", _attrib.Rect.Width.ToString()); icon.SetAttribute("Height", _attrib.Rect.Height.ToString()); icon.SetAttribute("ImageFile", _attrib.PicIconData.ImageFileName); icon.SetAttribute("ImageShowName", _attrib.PicIconData.ShowName); }
/// <summary> /// 保存线条控件数据到xml文件中 /// </summary> /// <param Name="xml">xml对象</param> public override void saveXML(SVXml xml) { XmlElement lineXml = xml.createNode(this.GetType().Name); lineXml.SetAttribute("id", _attrib.ID.ToString()); lineXml.SetAttribute("x", _attrib.start.X.ToString()); lineXml.SetAttribute("y", _attrib.start.Y.ToString()); lineXml.SetAttribute("width", _attrib.LineWidth.ToString()); lineXml.SetAttribute("length", _attrib.LineLength.ToString()); lineXml.SetAttribute("color", _attrib.LineColor.ToArgb().ToString()); lineXml.SetAttribute("type", _attrib.ShowType.ToString()); }
override public void saveXML(SVXml xml) { XmlElement label = xml.createNode(this.GetType().Name); label.SetAttribute("ID", _attrib.ID.ToString()); label.SetAttribute("X", _attrib.Rect.X.ToString()); label.SetAttribute("Y", _attrib.Rect.Y.ToString()); label.SetAttribute("Width", _attrib.Rect.Width.ToString()); label.SetAttribute("Height", _attrib.Rect.Height.ToString()); label.SetAttribute("Color", _attrib.FrontColorground.ToArgb().ToString()); label.SetAttribute("Backcolor", _attrib.BackColorground.ToArgb().ToString()); label.SetAttribute("TextAlign", _attrib.Align.ToString()); label.SetAttribute("Text", _attrib.Text); label.SetAttribute("Font", _attrib.Font.Name.ToString()); label.SetAttribute("FontSize", _attrib.Font.Size.ToString()); label.SetAttribute("Transparent", _attrib.Transparent.ToString()); }
override public void saveXML(SVXml xml) { XmlElement gif = xml.createNode(this.GetType().Name); gif.SetAttribute("ID", _attrib.ID.ToString()); gif.SetAttribute("X", _attrib.Rect.X.ToString()); gif.SetAttribute("Y", _attrib.Rect.Y.ToString()); gif.SetAttribute("Width", _attrib.Rect.Width.ToString()); gif.SetAttribute("Height", _attrib.Rect.Height.ToString()); ///出错图片保存 gif.SetAttribute("ErrorFile", _attrib.PicError.ImageFileName); gif.SetAttribute("ErrorShowName", _attrib.PicError.ShowName); ///保存变量 Int32 i = 0; foreach (var name in _attrib.VarName) { XmlElement nameList = xml.crateChildNode("VarName"); gif.AppendChild(nameList); nameList.SetAttribute("VName", name); nameList.SetAttribute("VType", _attrib.VarType[i].ToString()); i++; } ///保存背景图片数据 List <SVBitmap> list = _attrib.Pic.imageArray(); foreach (var item in list) { XmlElement picList = xml.crateChildNode("PIC"); gif.AppendChild(picList); picList.SetAttribute("Name", item.ShowName); picList.SetAttribute("File", item.ImageFileName); } }
/// <summary> /// 保存数据到xml文件中 /// </summary> /// <param Name="xml">xml文件对象</param> override public void saveXML(SVXml xml) { XmlElement curve = xml.createNode(this.GetType().Name); curve.SetAttribute("ID", _attrib.ID.ToString()); curve.SetAttribute("X", _attrib.Rect.X.ToString()); curve.SetAttribute("Y", _attrib.Rect.Y.ToString()); curve.SetAttribute("Width", _attrib.Rect.Width.ToString()); curve.SetAttribute("Height", _attrib.Rect.Height.ToString()); curve.SetAttribute("FrontColor", _attrib.FrontColor.ToArgb().ToString()); curve.SetAttribute("BackgdColor", _attrib.BackgdColor.ToArgb().ToString()); curve.SetAttribute("Interval", _attrib.Interval.ToString()); curve.SetAttribute("Font", _attrib.Font.Name.ToString()); curve.SetAttribute("FontSize", _attrib.Font.Size.ToString()); curve.SetAttribute("Max", _attrib.Max.ToString()); curve.SetAttribute("Min", _attrib.Min.ToString()); curve.SetAttribute("Count", _attrib.Variable.Count.ToString()); ///保存变量的字段 foreach (var varTmp in _attrib.Variable) { XmlElement nameList = xml.crateChildNode("VarName"); curve.AppendChild(nameList); nameList.SetAttribute("Value", varTmp.Var.VarName); XmlElement typeList = xml.crateChildNode("VarType"); curve.AppendChild(typeList); typeList.SetAttribute("Value", varTmp.Var.VarBlockType.ToString()); XmlElement colorList = xml.crateChildNode("VarColor"); curve.AppendChild(colorList); colorList.SetAttribute("Value", varTmp.Color.ToArgb().ToString()); XmlElement enableList = xml.crateChildNode("varEnabled"); curve.AppendChild(enableList); enableList.SetAttribute("Value", varTmp.Enabled.ToString()); } }
/// <summary> /// 保存当前按钮内容到xml文件中 /// </summary> /// <param Name="xml">xml对象</param> override public void saveXML(SVXml xml) { XmlElement button = xml.createNode(this.GetType().Name); button.SetAttribute("id", _attrib.ID.ToString()); button.SetAttribute("x", _attrib.Rect.X.ToString()); button.SetAttribute("y", _attrib.Rect.Y.ToString()); button.SetAttribute("width", _attrib.Rect.Width.ToString()); button.SetAttribute("height", _attrib.Rect.Height.ToString()); ///循环保存图片数组 List <SVBitmap> list = _attrib.BitMapArray.imageArray(); foreach (var item in list) { XmlElement picList = xml.crateChildNode("PIC"); button.AppendChild(picList); picList.SetAttribute("Name", item.ShowName); picList.SetAttribute("File", item.ImageFileName); } }
override public void saveXML(SVXml xml) { XmlElement binary = xml.createNode(this.GetType().Name); ///写入尺寸 binary.SetAttribute("ID", _attrib.ID.ToString()); binary.SetAttribute("X", _attrib.Rect.X.ToString()); binary.SetAttribute("Y", _attrib.Rect.Y.ToString()); binary.SetAttribute("Width", _attrib.Rect.Width.ToString()); binary.SetAttribute("Height", _attrib.Rect.Height.ToString()); ///写入变量 binary.SetAttribute("Variable", _attrib.Variable.VarName); binary.SetAttribute("VarialeType", _attrib.Variable.VarBlockType.ToString()); ///写入自定义名称 binary.SetAttribute("CustomTrueText", _attrib.CustomTrueText); binary.SetAttribute("CustomFalseText", _attrib.CustomFlaseText); //binary.SetAttribute("CustomExText", _attrib.CustomExceptionText); ///图片 binary.SetAttribute("TImageFile", _attrib.TruePicture.ImageFileName); binary.SetAttribute("TImageShowName", _attrib.TruePicture.ShowName); binary.SetAttribute("FImageFile", _attrib.FlasePicture.ImageFileName); binary.SetAttribute("FImageShowName", _attrib.FlasePicture.ShowName); binary.SetAttribute("EImageFile", _attrib.ExPicture.ImageFileName); binary.SetAttribute("EImageShowName", _attrib.ExPicture.ShowName); binary.SetAttribute("TrueColor", _attrib.TrueColor.ToArgb().ToString()); binary.SetAttribute("TrueBgColor", _attrib.TrueBgColor.ToArgb().ToString()); binary.SetAttribute("FalseColor", _attrib.FalseColor.ToArgb().ToString()); binary.SetAttribute("FalseBgColor", _attrib.FalseBgColor.ToArgb().ToString()); binary.SetAttribute("Font", _attrib.Font.Name.ToString()); binary.SetAttribute("FontSize", _attrib.Font.Size.ToString()); binary.SetAttribute("Type", _attrib.Type.ToString()); binary.SetAttribute("ExceptionColor", _attrib.ExceptionColor.ToArgb().ToString()); binary.SetAttribute("ExceptionBgColor", _attrib.ExceptionBgColor.ToArgb().ToString()); }
/// <summary> /// 保存当前按钮内容到xml文件中 /// </summary> /// <param Name="xml">xml对象</param> override public void saveXML(SVXml xml) { XmlElement button = xml.createNode(this.GetType().Name); button.SetAttribute("id", _attrib.ID.ToString()); button.SetAttribute("x", _attrib.Rect.X.ToString()); button.SetAttribute("y", _attrib.Rect.Y.ToString()); button.SetAttribute("width", _attrib.Rect.Width.ToString()); button.SetAttribute("height", _attrib.Rect.Height.ToString()); button.SetAttribute("color", _attrib.FrontColorground.ToArgb().ToString()); button.SetAttribute("backcolor", _attrib.BackColorground.ToArgb().ToString()); button.SetAttribute("backgdcolor", _attrib.BackColorgroundDown.ToArgb().ToString()); button.SetAttribute("text", _attrib.Text); button.SetAttribute("falseText", _attrib.FText); button.SetAttribute("font", _attrib.Font.Name.ToString()); button.SetAttribute("fontSize", _attrib.Font.Size.ToString()); button.SetAttribute("Confirm", _attrib.Comfirm.ToString()); button.SetAttribute("ButtonType", _attrib.ButtonType.ToString()); button.SetAttribute("ButtonTypeID", _attrib.ButtonPage.PageID.ToString()); button.SetAttribute("ButtonTypeText", _attrib.ButtonPage.PageText); button.SetAttribute("ButtonTypeVar", _attrib.BtnVarText.VarName); button.SetAttribute("ButtonTypeVarType", _attrib.BtnVarText.VarBlockType.ToString()); //按钮使能 button.SetAttribute("Enabled", _attrib.BtnEnable.ToString()); button.SetAttribute("EnabledVar", _attrib.EnVarText.VarName); button.SetAttribute("EnabledVarType", _attrib.EnVarText.VarBlockType.ToString()); //按钮图片数据 button.SetAttribute("IsShowPicture", _attrib.IsShowPic.ToString()); button.SetAttribute("BtnDownPicFile", _attrib.BtnDownPic.ImageFileName); button.SetAttribute("BtnDownPicShowName", _attrib.BtnDownPic.ShowName); button.SetAttribute("BtnUpPicFile", _attrib.BtnUpPic.ImageFileName); button.SetAttribute("BtnUpPicShowName", _attrib.BtnUpPic.ShowName); //趋势图关联 button.SetAttribute("CurveObj", _attrib.CurveObj); }