public void AddObject(Prototype obj) { for (int loop1 = 0; loop1 < styles.Count; loop1++) if (styles[loop1].prototype.Name == obj.Name) { InitStyles(obj,styles[loop1]); return; } StylesList te = new StylesList(this,obj,styles.Count==0 ? Top : styles[styles.Count-1].Top); InitStyles(obj, te); styles.Add(te); }
public StylesList(Conveer conv,Prototype proto,int top=0) { tipok.IsBalloon = true; owner = conv; prototype = proto; currtop = top; onoff = new CheckBox(); onoff.ThreeState = true; onoff.Checked = false; Name = prototype.Name; onoff.Text=Name; onoff.Left = 5; onoff.Top = top + 5; onoff.AutoSize = false; onoff.Width = owner.objectscontainer.Width - 20; onoff.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; onoff.BackColor = System.Drawing.Color.LightBlue; currtop += 10 + onoff.Height; owner.objectscontainer.Controls.Add(onoff); }
void InitStyles(Prototype pt, StylesList sl) { Style[] st = pt.InitStyles(); for (int loop1 = 0; loop1 < st.Length; loop1++) if (sl.GetPos(st[loop1].name) == -1) sl.Add(st[loop1]); }