public Report(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base() { Control t; Band b; int h; Bands = new BandList(); this.SuspendLayout(); this.Tag = (string)info.GetValue("Name", typeof(string)); this.BackColor = (Color)info.GetValue("BGColor", typeof(Color)); this.Width = (int)info.GetValue("Width", Type.GetType("System.Int32")); this.Height = (int)info.GetValue("Height", Type.GetType("System.Int32")); this.Items = (ArrayList)info.GetValue( "Items", Type.GetType("System.Collections.ArrayList")); for (int i = 0; i < this.Items.Count; i++) { t = (Control)info.GetValue("Items[" + i.ToString() + "]", typeof(Control)); if (t.GetType() == typeof(ReportManager.Controls.SMTextBox)) { ((ReportManager.Controls.SMTextBox)t).MoveNext += new Controls.MoveNextControls(shd); } if (t.Text.CompareTo("today") == 0) { t.Text = DateTime.Now.ToShortDateString(); } if (t.Name == "docs") { ((ComboBox)t).Items.Clear(); ((ComboBox)t).Items.AddRange(TextManager.StringsFromFile(".\\docs.cfg")); } this.Items[i] = (System.Windows.Forms.Control)t; /**/ h = t.Top; b = this.Bands.GetBandAtHeight(h); t.Top = 0; b.Controls.Add(t); /*if(!this.Controls.Contains(b)) * this.Controls.Add(b);*/ /* * this.Controls.Add(t);*/ } Bands.SortByPosition(); for (int i = 0; i < Bands.Count; i++) { //Bands[i].Dock = DockStyle.Top; this.Controls.Add(Bands[i]); } this.ResumeLayout(false); }
public Report() : base() { Items = new ArrayList(); Bands = new BandList(); // // Required for Windows Form Designer support // //InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // foreach (Control t in this.Controls) { Items.Add(t); } }