// Creates a new decoration element if it does not exist in the decoration element list. // If there are no elements in the decoration list, add the decoration element to the list. public void CreateDecorationElement(DecorationElement decorationElement) { if (DeList.Count != 0) { foreach (DecorationElement element in DeList.ToList()) { if (decorationElement.name == element.name) { // The two elements are called the same, therfore, it can not be added to the list. // Eventually ask the user to change the name of the element. //throw new DecorationElementAlreadyExistsException("Cannot create a Decoration Element with the same name of another!"); break; } else { DeList.Add(decorationElement); } } } else { DeList.Add(decorationElement); } }
public void DeleteDecorationElement(DecorationElement decorationElement) { DeList.Remove(decorationElement); }