Example #1
0
 public virtual void WriteToXml(XmlDocument xmlDoc, XmlElement xmlElement)
 {
     xmlElement.SetAttribute("Type", this.GetType().Name);
     xmlElement.SetAttribute("DrawType", objectType.ToString());
     xmlElement.SetAttribute("ObjName", ObjName);
     xmlElement.SetAttribute("Run", this._run.ToString());
     xmlElement.SetAttribute("Lock", _lock.ToString());
     xmlElement.SetAttribute("ID", this.id.ToString());
     xmlElement.SetAttribute("Click", Click);
     xmlElement.SetAttribute("DoubleClick", DoubleClick);
     xmlElement.SetAttribute("Format", Format);
     xmlElement.SetAttribute("textName", textName);
     xmlElement.SetAttribute("xName", xName);
     xmlElement.SetAttribute("yName", yName);
     xmlElement.SetAttribute("widthName", widthName);
     xmlElement.SetAttribute("heightName", heightName);
     xmlElement.SetAttribute("visibleName", visibleName);
     xmlElement.SetAttribute("FillColorName", FillColorName);
     xmlElement.SetAttribute("Color", Color.ToArgb().ToString());
     xmlElement.SetAttribute("PenWidth", PenWidth.ToString());
     xmlElement.SetAttribute("X", X.ToString());
     xmlElement.SetAttribute("Y", Y.ToString());
     xmlElement.SetAttribute("Width", Width.ToString());
     xmlElement.SetAttribute("Height", Height.ToString());
 }
        /// <summary>
        /// Save object to xml file
        /// </summary>
        void IXmlable.ToXml(XmlElement xmlEle, IXmlContext cnt)
        {
            // border color
            XmlToolkit.SetAttribute(xmlEle, MkaDefine.FormatTagBorderColor, BorderColorHtml);

            // pen width
            XmlToolkit.SetAttribute(xmlEle, MkaDefine.FormatTagPenWidth, PenWidth.ToString());

            // fill color
            XmlToolkit.SetAttribute(xmlEle, MkaDefine.FormatTagFillColor, FillColorHtml);

            // transparent
            XmlToolkit.SetAttribute(xmlEle, MkaDefine.FormatTagFillColorAlpha, FillColorAlpha.ToString());

            // r show position
            XmlToolkit.SetAttribute(xmlEle, MkaDefine.FormatTagRShowPosition, this.RShowPosition.ToString());

            // r show position
            String location = String.Format("({0},{1}))", RShowLocation.X, RShowLocation.Y);

            XmlToolkit.SetAttribute(xmlEle, MkaDefine.FormatTagRShowLocation, location);
        }