/// <summary> /// Remove object by index. /// Used for Undo. /// </summary> public void RemoveAt(int index) { DrawObject o = graphicsList[index]; // if (o.DrawArea != null) o.DrawArea.EndTextBoxEdit(false); graphicsList.RemoveAt(index); //onGateRemoved(); OnDrawObjsChanged(new ArrayChangedEventArgs <DrawObject>(o, ArrayChangedType.ItemRemoved)); }
/// <summary> /// Replace object in specified place. /// Used for Undo. /// </summary> public void Replace(int index, DrawObject obj) { if (index >= 0 && index < graphicsList.Count) { graphicsList.RemoveAt(index); graphicsList.Insert(index, obj); } }