private void method_1(XmlDocument xmlDocument_0) { XmlElement element = xmlDocument_0.SelectSingleNode("/Template") as XmlElement; string attribute = element.GetAttribute("Height"); string str2 = element.GetAttribute("Width"); string str3 = element.GetAttribute("Landscape"); string str4 = element.GetAttribute("Location"); this.aisinoPrintPanel_0 = new AisinoPrintPanel(element); this.PageSize = new Size(Common.ToInt(str2), Common.ToInt(attribute)); this._Landscape = Common.ToBool(str3); this.StartPoint = (PointF)Common.ToPoint(str4); }
public AisinoPrintControl(XmlElement xmlElement_0) { this._ID = string.Empty; this._width = 100f; this._height = 25f; this._Location = new PointF(0f, 0f); this._backColor = Color.Transparent; this._foreColor = Color.Black; this._lineColor = Color.Transparent; this._isPrint = true; this._Nodes = new List <AisinoPrintControl>(); this.absoluteLocation = new PointF(0f, 0f); this.gDpi = Graphics.FromImage(new Bitmap(10, 10)); string attribute = xmlElement_0.GetAttribute("Id"); string str2 = xmlElement_0.GetAttribute("Height"); string str3 = xmlElement_0.GetAttribute("Width"); string str4 = xmlElement_0.GetAttribute("BackColor"); string str5 = xmlElement_0.GetAttribute("ForeColor"); string str6 = xmlElement_0.GetAttribute("TaoDa"); string str7 = xmlElement_0.GetAttribute("LineWidth"); string str8 = xmlElement_0.GetAttribute("LineColor"); string str9 = xmlElement_0.GetAttribute("Location"); if (attribute != string.Empty) { this._ID = attribute; } if (str2 != string.Empty) { this.Height = Common.ToFloat(str2); } else if (this._parent != null) { this.Height = this._parent.Height; } if (str3 != string.Empty) { this.Width = Common.ToFloat(str3); } else if (this._parent != null) { this.Width = this._parent.Width; } if (str4 != string.Empty) { this.BackColor = Common.ToColor(str4); } if (str5 != string.Empty) { this.ForeColor = Common.ToColor(str5); } if (str8 != string.Empty) { this.LineColor = Common.ToColor(str8); } if (str6 != string.Empty) { this.IsPrint = Common.ToBool(str6); } this.LineWidth = 0; if (str7 != string.Empty) { this.LineWidth = Common.ToInt(str7); } if (str9 != string.Empty) { this.Location = Common.ToPointF(str9); } XmlNodeList childNodes = xmlElement_0.ChildNodes; if (childNodes.Count > 0) { foreach (XmlNode node in childNodes) { AisinoPrintControl control; XmlElement element = node as XmlElement; switch (node.Name) { case "Label": control = new AisinoPrintLabel(element); break; case "Line": control = new AisinoPrintLine(element); break; case "Panel": control = new AisinoPrintPanel(element); break; case "Repeater": control = new AisinoPrintRepeater(element); break; case "Image": control = new AisinoPrintImage(element); break; case "Check": control = new AisinoPrintCheck(element); break; case "Grid": control = new AisinoPrintGrid(element); break; case "HXM": control = new AisinoPrintAsHX(element); break; case "QRM": control = new AisinoPrintAsQR(element); break; case "PDF417": control = new GControl0(element); break; default: control = null; break; } if (control != null) { this.AddNode(control); } } } }