Esempio n. 1
0
        public string toXml()
        {
            System.Xml.Linq.XElement element = new System.Xml.Linq.XElement("Config");
            element.SetElementValue("TypeJson", TypeJson);
            element.SetElementValue("AutoOn", AutoOn);

            //RPC.Serialize.ParamsSerializeUtil.Serialize(this);
            return(element.ToString());
        }
Esempio n. 2
0
 private void WriteStringSafe(System.Xml.Linq.XElement el, string name, string s)
 {
     if (s != null)
     {
         el.SetElementValue(name, s);
     }
 }
Esempio n. 3
0
        public System.Xml.Linq.XDocument ToXML()
        {
            var dom        = new System.Xml.Linq.XDocument();
            var devinfo_el = new System.Xml.Linq.XElement("DeviceInfo");

            dom.Add(devinfo_el);


            this.WriteStringSafe(devinfo_el, "OutputFormat", this.OutputFormat);

            devinfo_el.SetElementValue("Toolbar", this.Capitalize(this.Toolbar.ToString()));

            this.WriteStringSafe(devinfo_el, "PageWidth", this.PageWidth);
            this.WriteStringSafe(devinfo_el, "PageHeight", this.PageHeight);
            this.WriteStringSafe(devinfo_el, "MarginTop", this.MarginTop);
            this.WriteStringSafe(devinfo_el, "MarginBottom", this.MarginBottom);
            this.WriteStringSafe(devinfo_el, "MarginLeft", this.MarginLeft);
            this.WriteStringSafe(devinfo_el, "MarginRight", this.MarginRight);

            if (this.PrintDpiX.HasValue)
            {
                devinfo_el.SetElementValue("PrintDpiX", this.PrintDpiX.ToString());
            }
            if (this.PrintDpiY.HasValue)
            {
                devinfo_el.SetElementValue("PrintDpiY", this.PrintDpiY.ToString());
            }
            if (this.DpiX.HasValue)
            {
                devinfo_el.SetElementValue("DpiX", this.DpiX.ToString());
            }
            if (this.DpiY.HasValue)
            {
                devinfo_el.SetElementValue("DpiY", this.DpiY.ToString());
            }


            return(dom);
        }
Esempio n. 4
0
        public System.Xml.Linq.XDocument ToXML()
        {
            var dom = new System.Xml.Linq.XDocument();
            var devinfo_el = new System.Xml.Linq.XElement("DeviceInfo");
            dom.Add(devinfo_el);


            this.WriteStringSafe(devinfo_el, "OutputFormat", this.OutputFormat);

            devinfo_el.SetElementValue("Toolbar", this.Capitalize(this.Toolbar.ToString()));

            this.WriteStringSafe(devinfo_el, "PageWidth", this.PageWidth);
            this.WriteStringSafe(devinfo_el, "PageHeight", this.PageHeight);
            this.WriteStringSafe(devinfo_el, "MarginTop", this.MarginTop);
            this.WriteStringSafe(devinfo_el, "MarginBottom", this.MarginBottom);
            this.WriteStringSafe(devinfo_el, "MarginLeft", this.MarginLeft);
            this.WriteStringSafe(devinfo_el, "MarginRight", this.MarginRight);

            if (this.PrintDpiX.HasValue)
            {
                devinfo_el.SetElementValue("PrintDpiX", this.PrintDpiX.ToString());
            }
            if (this.PrintDpiY.HasValue)
            {
                devinfo_el.SetElementValue("PrintDpiY", this.PrintDpiY.ToString());
            }
            if (this.DpiX.HasValue)
            {
                devinfo_el.SetElementValue("DpiX", this.DpiX.ToString());
            }
            if (this.DpiY.HasValue)
            {
                devinfo_el.SetElementValue("DpiY", this.DpiY.ToString());
            }


            return dom;
        }