public void AddLine(Line ln) { lock (this) lines.Add(ln); ln.Id = lineId++; Version++; HistoryManager.StoreState(this); }
public void AddLines(IEnumerable <Line> lns) { lock (this) lines.AddRange(lns); foreach (Line ln in lns) { ln.Id = lineId++; } Version++; HistoryManager.StoreState(this); }
public void SetSelectionBrush(PBrush brush) { lock (this) { for (int i = 0; i < lines.Count; i++) { if (lines[i].Selected) { lines[i].Brush = brush; } } HistoryManager.StoreState(this); Version++; } }
public void RemoveLine(int ind) { lock (this) { Line line = GetLine(ind); if (line.Selected) { for (int i = 0; i < lines.Count; i++) { if (lines[i].Selected) { lines.RemoveAt(i--); } } } else { lines.RemoveAt(ind); } Version++; } HistoryManager.StoreState(this); }