Exemplo n.º 1
0
        private RemoveChildEvent RequestRemoval(Thing thingToRemove)
        {
            // Create and raise a removal event request.
            var removeChildEvent = new RemoveChildEvent(thingToRemove);

            Eventing.OnMovementRequest(removeChildEvent, EventScope.SelfDown);
            return(removeChildEvent);
        }
Exemplo n.º 2
0
        private AddChildEvent RequestAdd(Thing thingToAdd)
        {
            // Prepare an add event request, and ensure both the new parent (this) and the
            // thing itself both get a chance to cancel this request before committing.
            var addChildEvent = new AddChildEvent(thingToAdd, this);

            Eventing.OnMovementRequest(addChildEvent, EventScope.SelfDown);
            thingToAdd.Eventing.OnMovementRequest(addChildEvent, EventScope.SelfDown);
            return(addChildEvent);
        }