Beispiel #1
0
        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));
 }
Beispiel #3
0
 public void RemObjectFromScenario(DynamicElement obj)
 {
     ObjectsList.Remove(obj);
 }