Пример #1
0
 /// <summary>
 /// When adding a new ADTObject we need to add a drawable oject as well.
 /// The map will allows up to synchronized them.
 /// </summary>
 /// <param name="o"></param>
 public void addNewADTObject(ADTObject o)
 {
     DDTObject newObject = new DDTObject(DDT_Obj_Type.ADT, o.name);
     aObjects.Add(o);
     objects.Add(newObject);
     objectMaps.Add(new DDTObjectMap(o.ID, newObject.ID));
 }
Пример #2
0
        /// <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 removeADTObject(ADTObject o)
        {
            int id = 0;
            foreach (DDTObjectMap current in objectMaps)
            {
                if (current.oId == o.ID)
                {
                    id = current.ddtOId;
                }
            }
            removeDDTObject(id);

            aObjects.Remove(o);
        }