public void Remove(BaseType b) { for (int x = 0; x < bList.Count; x++ ) { if (b.Id == bList[x].Id) { bList.RemoveAt(x); //break; } } }
public void Add(BaseType b) { if (b.type == CompType.box) { string sText = b.Text; int x = 0; int y = 0; int z = 0; foreach (char c in sText) { if (c == '\r') { x += 1; } else if (c == '\n') { z = x; y += 1; } else { _m[y + b.StartPt.Y, x + b.StartPt.X - z] = c; x += 1; } } } else if (b.type == CompType.Link) { int Length = b.Text.Length; int xEnd = 0; if (b.Text.Contains("-")) { for (int i = 1; i <= Length; i++) { _m[b.StartPt.Y, b.StartPt.X + i] = '-'; } } else if (b.Text.Contains("|")) { for (int i = 1; i <= Length; i++) { _m[b.StartPt.Y + i, b.StartPt.X] = '|'; } } } else if (b.type == CompType.Arrow || b.type == CompType.point) { _m[b.StartPt.Y, b.StartPt.X] = b.Text[0]; } }
public void Add(BaseType b) { bList.Add(b); }
private void button9_Click(object sender, EventArgs e) // detect and select Box { bool status = false; foreach (BaseType b in model.GetList) { status = b.Detect(GetLineAndPos()); if (status) { SelectedBox = b; button10.Enabled = true; button12.Enabled = true; button14.Enabled = true; break; } } }