public void Delete(User actionExecutor, MapObject mapObject) { var foundMapObject = ObjectsList.FirstOrDefault(x => x == mapObject); if (foundMapObject == null) { throw new ArgumentNullException(nameof(foundMapObject), "Object not found"); } if (Memberships.All(x => x.InvitedId != actionExecutor.Id)) { throw new DomainException("Have no access to map."); } foundMapObject.FileReferencesBindings.ForEach(binding => binding.FileReference.ScheduleToRemove()); foundMapObject.MarkAsRemoved(); ObjectsList.Remove(foundMapObject); AddEvent(new MapObjectRemoved(foundMapObject)); }
public virtual bool Remove(IDrawable drawable) { return(list.Remove(drawable)); }
public void RemObjectFromScenario(DynamicElement obj) { ObjectsList.Remove(obj); }