/// <summary> /// When removing an object we have to also remove the drawable object /// and any relations in a diagram to it. /// </summary> /// <param name="o">object to remove </param> public void removeSMObject(SMObject o) { int id = 0; foreach (DDTObjectMap current in objectMaps) { if (current.oId == o.ID) { id = current.ddtOId; } } removeDDTObject(id); smObjects.Remove(o); }
/// <summary> /// When adding a new SMObject we need to add a drawable oject as well. /// The map will allows up to synchronized them. /// </summary> /// <param name="o"></param> public void addNewSMObject(SMObject o) { DDTObject newObject = new DDTObject(DDT_Obj_Type.SMOBJECT, o.name); smObjects.Add(o); objects.Add(newObject); objectMaps.Add(new DDTObjectMap(o.ID, newObject.ID)); }