예제 #1
0
 private void ReadLineII(System.Windows.Forms.Control par, ReadXml read, string path)
 {
     foreach (ReadXml r in read.ReadList(path))
     {
         var con = new LineII();
         con.Left   = Convert.ToInt32(r.Read("left"));
         con.Top    = Convert.ToInt32(r.Read("top"));
         con.Width  = Convert.ToInt32(r.Read("width"));
         con.Height = Convert.ToInt32(r.Read("height"));
         par.Controls.Add(con);
     }
 }
예제 #2
0
 private void ReadText(System.Windows.Forms.Control par, ReadXml read, string path)
 {
     foreach (ReadXml r in read.ReadList(path))
     {
         var con = new TextLabel();
         con.Left   = Convert.ToInt32(r.Read("left"));
         con.Top    = Convert.ToInt32(r.Read("top"));
         con.Width  = Convert.ToInt32(r.Read("width"));
         con.Height = Convert.ToInt32(r.Read("height"));
         con.Font   = new Font(r.Read("font_name"), Convert.ToSingle(r.Read("font_size")), (FontStyle)Convert.ToInt32(r.Read("font_style")));
         con.Text   = r.Read("text");
         par.Controls.Add(con);
     }
 }
예제 #3
0
 public void ReadFromXML(string xml)
 {
     try
     {
         ReadXml read = new ReadXml(xml);
         //
         this.pnl.Width  = Convert.ToInt32(read.Read("width"));
         this.pnl.Height = Convert.ToInt32(read.Read("height"));
         //
         this.panel1.Width  = Convert.ToInt32(read.Read("block1/width"));
         this.panel1.Height = Convert.ToInt32(read.Read("block1/height"));
         this.panel2.Width  = Convert.ToInt32(read.Read("block2/width"));
         this.panel2.Height = Convert.ToInt32(read.Read("block2/height"));
         this.panel3.Width  = Convert.ToInt32(read.Read("block3/width"));
         this.panel3.Height = Convert.ToInt32(read.Read("block3/height"));
         //
         ReadField(this.panel1, read, "block1/field");
         ReadField(this.panel2, read, "block2/field");
         ReadField(this.panel3, read, "block3/field");
         //
         ReadText(this.panel1, read, "block1/text");
         ReadText(this.panel2, read, "block2/text");
         ReadText(this.panel3, read, "block3/text");
         //
         ReadLine(this.panel1, read, "block1/line");
         ReadLine(this.panel2, read, "block2/line");
         ReadLine(this.panel3, read, "block3/line");
         //
         ReadLineII(this.panel1, read, "block1/lineII");
         ReadLineII(this.panel2, read, "block2/lineII");
         ReadLineII(this.panel3, read, "block3/lineII");
         //
         ReadPicture(this.panel1, read, "block1/picture");
         ReadPicture(this.panel2, read, "block2/picture");
         ReadPicture(this.panel3, read, "block3/picture");
     }
     catch (Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
     }
 }