// ------------------------------------------------------------------ /// <summary> /// Removes all entities that are currently selected. /// </summary> /// <param name="entity">The entity.</param> // ------------------------------------------------------------------ public void RemoveSelectedItems() { if (this.Selection.SelectedItems.Count < 1) { return; } int numberOfItems = this.Selection.SelectedItems.Count; for (int i = 0; i < numberOfItems - 1; i++) { IDiagramEntity entity = Selection.SelectedItems[0]; foreach (IPage page in mPages) { foreach (ILayer layer in page.Layers) { if (layer.Entities.Contains(entity)) { layer.Entities.Remove(entity); entity.Detached(DefaultPage.DefaultLayer); } } } } }
// ------------------------------------------------------------------ /// <summary> /// Removes the specified entity. /// </summary> /// <param name="entity">The entity.</param> // ------------------------------------------------------------------ public void Remove(IDiagramEntity entity) { if (CurrentPage.DefaultLayer.Entities.Contains(entity)) { CurrentPage.DefaultLayer.Entities.Remove(entity); entity.Detached(CurrentPage.DefaultLayer); } }
// ------------------------------------------------------------------ /// <summary> /// Removes the specified entity. /// </summary> /// <param name="entity">The entity.</param> // ------------------------------------------------------------------ public void Remove(IDiagramEntity entity) { if (CurrentPage.DefaultLayer.Entities.Contains(entity)) { CurrentPage.DefaultLayer.Entities.Remove(entity); entity.Detached(CurrentPage.DefaultLayer); } }