Example #1
0
 private void LoadTempalteInfoCall0Call1(PrintSetting tempalte, XmlNode childNode, string childName)
 {
     if (childName != null)
     {
         if (!(childName == "Logo1"))
         {
             if (!(childName == "Logo2"))
             {
                 if (!(childName == "Legend"))
                 {
                     if (childName == "Map")
                     {
                         this.ParsMapNode(tempalte, childNode);
                     }
                 }
                 else
                 {
                     PrintControl legendControl = this.ParsePrintControlNode(childNode);
                     legendControl.property.bitMapPos = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "legendView.bmp");
                     tempalte.LegendControl           = legendControl;
                 }
             }
             else
             {
                 PrintControl logo2Control = this.ParsePrintControlNode(childNode);
                 tempalte.Logo2Control = logo2Control;
             }
         }
         else
         {
             PrintControl logo1Control = this.ParsePrintControlNode(childNode);
             tempalte.Logo1Control = logo1Control;
         }
     }
 }
Example #2
0
 private void LoadTempalteInfoCall0Call0(PrintSetting tempalte, XmlNode childNode, string childName)
 {
     if (childName != null)
     {
         if (!(childName == "Page"))
         {
             if (!(childName == "title"))
             {
                 if (!(childName == "Footer"))
                 {
                     if (childName == "Comments")
                     {
                         PrintControl commensControl = this.ParsePrintControlNode(childNode);
                         tempalte.CommensControl = commensControl;
                     }
                 }
                 else
                 {
                     PrintControl headerControl = this.ParsePrintControlNode(childNode);
                     tempalte.HeaderControl = headerControl;
                 }
             }
             else
             {
                 PrintControl titleControl = this.ParsePrintControlNode(childNode);
                 tempalte.TitleControl = titleControl;
             }
         }
         else
         {
             this.ParsePageNode(tempalte, childNode);
         }
     }
 }
Example #3
0
        private PrintControl ParsePrintControlNode(XmlNode childNode)
        {
            PrintControl result = default(PrintControl);

            foreach (XmlNode xmlNode in childNode)
            {
                if (xmlNode.Name.Equals("Position"))
                {
                    bool   isSelected = Convert.ToBoolean(xmlNode.Attributes.GetNamedItem("enable").Value);
                    string value      = xmlNode.Attributes.GetNamedItem("vPos").Value;
                    string value2     = xmlNode.Attributes.GetNamedItem("hPos").Value;
                    bool   isOnMap    = Convert.ToBoolean(xmlNode.Attributes.GetNamedItem("insideMap").Value);
                    int    width      = Convert.ToInt32(xmlNode.Attributes.GetNamedItem("width").Value);
                    int    height     = Convert.ToInt32(xmlNode.Attributes.GetNamedItem("height").Value);
                    int    top        = Convert.ToInt32(xmlNode.Attributes.GetNamedItem("top").Value);
                    int    left       = Convert.ToInt32(xmlNode.Attributes.GetNamedItem("left").Value);
                    result.isSelected      = isSelected;
                    result.posVert         = (Vert)Enum.Parse(typeof(Vert), value);
                    result.posHori         = (Hori)Enum.Parse(typeof(Hori), value2);
                    result.isOnMap         = isOnMap;
                    result.property.top    = top;
                    result.property.left   = left;
                    result.property.width  = width;
                    result.property.height = height;
                }
                else if (xmlNode.Name.Equals("text"))
                {
                    string comment = xmlNode.InnerText.Trim();
                    result.property.comment = comment;
                }
                else if (xmlNode.Name.Equals("font"))
                {
                    float     emSize = Convert.ToSingle(xmlNode.Attributes.GetNamedItem("size").Value);
                    string    value3 = xmlNode.Attributes.GetNamedItem("font").Value;
                    string    value4 = xmlNode.Attributes.GetNamedItem("fontStyle").Value;
                    FontStyle style  = (FontStyle)Enum.Parse(typeof(FontStyle), value4);
                    Font      font   = new Font(value3, emSize, style, GraphicsUnit.Point, 134);
                    result.property.font = font;
                }
                else if (xmlNode.Name.Equals("bitmap"))
                {
                    string bitMapPos = xmlNode.InnerText.Trim();
                    result.property.bitMapPos = bitMapPos;
                }
            }
            return(result);
        }