public Temp(Robot r, string strkey, object objvalue) { this.r = r; key = new Label(); key.AutoSize = true; key.Text = strkey; value = new Label(); value.Font = new Font("Arial", 12, FontStyle.Bold); value.AutoSize = true; value.Text = objvalue.ToString(); if (r.Temps.Count == 0) { Label seperator = new Label(); seperator.AutoSize = true; seperator.Text = "|"; seperator.Font = new Font("Arial", 12, FontStyle.Bold); r.positionNextTo(r.Elements[r.Elements.Count - 1].value, seperator); r.positionNextTo(seperator, value); r.positionOnTop(value, key); r.container.Invoke(new Action(delegate() { r.container.Controls.Add(seperator); r.container.Controls.Add(value); r.container.Controls.Add(key); })); } else { r.positionNextTo(r.Temps[r.Temps.Count - 1].value, value); r.positionOnTop(value, key); r.container.Invoke(new Action(delegate() { r.container.Controls.Add(value); r.container.Controls.Add(key); })); } }
public Element(Robot r, string strkey, object objvalue) { this.r = r; value = new Label(); value.Font = new Font("Arial", 12, FontStyle.Bold); value.AutoSize = true; value.Text = objvalue.ToString(); if (r.Elements.Count == 0) { r.positionInside(r.container, value, r.values.Length); } else { r.positionNextTo(r.Elements[r.Elements.Count - 1].value, value); } key = new Label(); key.AutoSize = true; key.Text = strkey; r.positionOnTop(value, key); r.container.Controls.Add(key); r.container.Controls.Add(value); }