public void GetXinhuaGraphicXml(XmlTextWriter xmlWriter) { xmlWriter.WriteStartElement("Element"); xmlWriter.WriteAttributeString("type", LogicObjectType.Line); xmlWriter.WriteAttributeString("X1", Convert.ToString(this.point1.X * 10)); xmlWriter.WriteAttributeString("Y1", Convert.ToString(this.point1.Y * 10)); xmlWriter.WriteAttributeString("X2", Convert.ToString(this.point2.X * 10)); xmlWriter.WriteAttributeString("Y2", Convert.ToString(this.point2.Y * 10)); xmlWriter.WriteAttributeString("PenStyle", ((int)this.lineType).ToString()); xmlWriter.WriteAttributeString("PenWidth", "0"); xmlWriter.WriteAttributeString("PenColor", ColorHelper.ColorToString(this.ForeColor)); xmlWriter.WriteAttributeString("DynamicOp", this.Dynamics.Count.ToString()); { // 添加动态属性 xmlWriter.WriteStartElement("Element"); xmlWriter.WriteAttributeString("type", "DynamicOp"); foreach (DynamicObject dynamic in this.Dynamics) { ILogicGraphicFormat dynamicFormat = dynamic as ILogicGraphicFormat; if (dynamicFormat != null) { dynamicFormat.GetXinhuaGraphicXml(xmlWriter); } } xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); }
public void GetXinhuaGraphicXml(XmlTextWriter xmlWriter) { xmlWriter.WriteStartElement("Element"); xmlWriter.WriteAttributeString("type", LogicObjectType.Polygon); xmlWriter.WriteAttributeString("PointNum", this.points.Length.ToString()); for (int i = 0; i < points.Length; i++) { xmlWriter.WriteAttributeString("X" + i.ToString(), Convert.ToString(this.points[i].X * 10)); xmlWriter.WriteAttributeString("Y" + i.ToString(), Convert.ToString(this.points[i].Y * 10)); } xmlWriter.WriteAttributeString("PenStyle", "0"); xmlWriter.WriteAttributeString("PenWidth", "0"); xmlWriter.WriteAttributeString("PenColor", ColorHelper.ColorToString(this.ForeColor)); xmlWriter.WriteAttributeString("BrushStyle", "1"); xmlWriter.WriteAttributeString("BrushColor", "FF FF FF FF"); xmlWriter.WriteAttributeString("DynamicOp", this.Dynamics.Count.ToString()); { // 添加动态属性 xmlWriter.WriteStartElement("Element"); xmlWriter.WriteAttributeString("type", "DynamicOp"); foreach (DynamicObject dynamic in this.Dynamics) { ILogicGraphicFormat dynamicFormat = dynamic as ILogicGraphicFormat; if (dynamicFormat != null) { dynamicFormat.GetXinhuaGraphicXml(xmlWriter); } } xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); }
public void GetXinhuaGraphicXml(XmlTextWriter xmlWriter) { xmlWriter.WriteStartElement("Element"); xmlWriter.WriteAttributeString("type", LogicObjectType.Rectangle); xmlWriter.WriteAttributeString("X1", Convert.ToString(this.x * 10)); xmlWriter.WriteAttributeString("Y1", Convert.ToString(this.y * 10)); xmlWriter.WriteAttributeString("X2", Convert.ToString((this.x + this.width) * 10)); xmlWriter.WriteAttributeString("Y2", Convert.ToString((this.y + this.height) * 10)); xmlWriter.WriteAttributeString("PenStyle", "0"); xmlWriter.WriteAttributeString("PenWidth", Convert.ToString(this.lineWidth * 10)); xmlWriter.WriteAttributeString("PenColor", ColorHelper.ColorToString(this.ForeColor)); xmlWriter.WriteAttributeString("BrushStyle", "1"); xmlWriter.WriteAttributeString("BrushColor", "FF FF FF FF"); xmlWriter.WriteAttributeString("DynamicOp", this.Dynamics.Count.ToString()); { // 添加动态属性 xmlWriter.WriteStartElement("Element"); xmlWriter.WriteAttributeString("type", "DynamicOp"); foreach (DynamicObject dynamic in this.Dynamics) { ILogicGraphicFormat dynamicFormat = dynamic as ILogicGraphicFormat; if (dynamicFormat != null) { dynamicFormat.GetXinhuaGraphicXml(xmlWriter); } } xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); }
public void GetXinhuaGraphicXml(XmlTextWriter xmlWriter) { xmlWriter.WriteStartElement("Element"); xmlWriter.WriteAttributeString("type", LogicObjectType.Arc); xmlWriter.WriteAttributeString("X1", Convert.ToString(this.centrePoint.X * 10)); xmlWriter.WriteAttributeString("Y1", Convert.ToString(this.centrePoint.Y * 10)); xmlWriter.WriteAttributeString("Width", Convert.ToString(this.Radius * 10)); xmlWriter.WriteAttributeString("Height", Convert.ToString(this.Radius * 10)); xmlWriter.WriteAttributeString("StartArg", GetXinHuaAngle(this.StartAngle).ToString()); xmlWriter.WriteAttributeString("EndArg", GetXinHuaAngle(this.EndAngle).ToString()); xmlWriter.WriteAttributeString("PenColor", ColorHelper.ColorToString(this.ForeColor)); xmlWriter.WriteAttributeString("PenStyle", "0"); xmlWriter.WriteAttributeString("PenWidth", "0"); xmlWriter.WriteAttributeString("DynamicOp", this.Dynamics.Count.ToString()); { // 添加动态属性 xmlWriter.WriteStartElement("Element"); xmlWriter.WriteAttributeString("type", "DynamicOp"); foreach (DynamicObject dynamic in this.Dynamics) { ILogicGraphicFormat dynamicFormat = dynamic as ILogicGraphicFormat; if (dynamicFormat != null) { dynamicFormat.GetXinhuaGraphicXml(xmlWriter); } } xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); }
public void GetXinhuaGraphicXml(System.Xml.XmlTextWriter xmlWriter) { xmlWriter.WriteStartElement("Element"); xmlWriter.WriteAttributeString("type", LogicObjectType.Poke); xmlWriter.WriteAttributeString("X1", Convert.ToString(this.X * 10)); xmlWriter.WriteAttributeString("Y1", Convert.ToString(this.Y * 10)); xmlWriter.WriteAttributeString("X2", Convert.ToString((this.X + this.Width) * 10)); xmlWriter.WriteAttributeString("Y2", Convert.ToString((this.Y + this.Height) * 10)); xmlWriter.WriteAttributeString("BlockID", this.BlockID.ToString()); xmlWriter.WriteAttributeString("DynamicOp", this.Dynamics.Count.ToString()); { // 添加动态属性 xmlWriter.WriteStartElement("Element"); xmlWriter.WriteAttributeString("type", "DynamicOp"); foreach (DynamicObject dynamic in this.Dynamics) { ILogicGraphicFormat dynamicFormat = dynamic as ILogicGraphicFormat; if (dynamicFormat != null) { dynamicFormat.GetXinhuaGraphicXml(xmlWriter); } } xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); }
public void GetXinhuaGraphicXml(System.Xml.XmlTextWriter xmlWriter) { if (this.signalType == DataType.Digital) { // 信号类型为数字量时,添加开关量颜色动态属性 DynDiColor diColor = new DynDiColor(this.pointName); this.Dynamics.Add(diColor); } xmlWriter.WriteStartElement("Element"); xmlWriter.WriteAttributeString("type", LogicObjectType.Signalline); xmlWriter.WriteAttributeString("PointNum", this.points.Length.ToString()); for (int i = 0; i < points.Length; i++) { xmlWriter.WriteAttributeString("X" + i.ToString(), Convert.ToString(this.points[i].X * 10)); xmlWriter.WriteAttributeString("Y" + i.ToString(), Convert.ToString(this.points[i].Y * 10)); } xmlWriter.WriteAttributeString("PenStyle", ((int)this.signalType).ToString()); xmlWriter.WriteAttributeString("PenWidth", "1"); xmlWriter.WriteAttributeString("PenColor", ColorHelper.ColorToString(this.ForeColor)); xmlWriter.WriteAttributeString("IsLinkLine", "1"); xmlWriter.WriteAttributeString("DynamicOp", this.Dynamics.Count.ToString()); { // 添加动态属性 xmlWriter.WriteStartElement("Element"); xmlWriter.WriteAttributeString("type", "DynamicOp"); foreach (DynamicObject dynamic in this.Dynamics) { ILogicGraphicFormat dynamicFormat = dynamic as ILogicGraphicFormat; if (dynamicFormat != null) { dynamicFormat.GetXinhuaGraphicXml(xmlWriter); } } xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); }
public void GetXinhuaGraphicXml(XmlTextWriter xmlWriter) { if (xmlWriter != null) { xmlWriter.WriteStartElement("Element"); xmlWriter.WriteAttributeString("type", LogicObjectType.Text); xmlWriter.WriteAttributeString("X1", Convert.ToString(this.X * 10)); xmlWriter.WriteAttributeString("Y1", Convert.ToString(this.Y * 10)); xmlWriter.WriteAttributeString("X2", Convert.ToString((this.X + this.width) * 10)); xmlWriter.WriteAttributeString("Y2", Convert.ToString((this.Y + this.height) * 10)); xmlWriter.WriteAttributeString("Alignment", ((int)this.alignment).ToString()); xmlWriter.WriteAttributeString("Font", this.font.FontFamily.Name); xmlWriter.WriteAttributeString("FontSize", this.font.Size.ToString()); xmlWriter.WriteAttributeString("FontStyle", ((int)this.font.Style).ToString()); xmlWriter.WriteAttributeString("FontColor", ColorHelper.ColorToString(this.ForeColor)); xmlWriter.WriteAttributeString("BrushType", "1"); xmlWriter.WriteAttributeString("BackColor", ColorHelper.ColorToString(this.BackColor)); xmlWriter.WriteAttributeString("StringContent", this.text); xmlWriter.WriteAttributeString("Angle", this.angle.ToString()); xmlWriter.WriteAttributeString("DynamicOp", this.Dynamics.Count.ToString()); // 添加动态属性 xmlWriter.WriteStartElement("Element"); xmlWriter.WriteAttributeString("type", "DynamicOp"); foreach (DynamicObject dynamic in this.Dynamics) { ILogicGraphicFormat dynamicFormat = dynamic as ILogicGraphicFormat; if (dynamicFormat != null) { dynamicFormat.GetXinhuaGraphicXml(xmlWriter); } } xmlWriter.WriteEndElement(); xmlWriter.WriteEndElement(); } }
public void GetXinhuaGraphicXml(XmlTextWriter xmlWriter) { xmlWriter.WriteStartElement("Element"); xmlWriter.WriteAttributeString("type", LogicObjectType.Symbol); xmlWriter.WriteAttributeString("X1", Convert.ToString(this.x * 10)); xmlWriter.WriteAttributeString("Y1", Convert.ToString(this.y * 10)); xmlWriter.WriteAttributeString("X2", Convert.ToString((this.x + this.width) * 10)); xmlWriter.WriteAttributeString("Y2", Convert.ToString((this.y + this.height) * 10)); xmlWriter.WriteAttributeString("DynamicOp", this.Dynamics.Count.ToString()); foreach (LogicObject logobj in this.Graphics) { ILogicGraphicFormat graphicFormat = logobj as ILogicGraphicFormat; if (graphicFormat != null) { graphicFormat.GetXinhuaGraphicXml(xmlWriter); } } { // 添加动态属性 xmlWriter.WriteStartElement("Element"); xmlWriter.WriteAttributeString("type", "DynamicOp"); foreach (DynamicObject dynamic in this.Dynamics) { ILogicGraphicFormat dynamicFormat = dynamic as ILogicGraphicFormat; if (dynamicFormat != null) { dynamicFormat.GetXinhuaGraphicXml(xmlWriter); } } xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); }