private RemoveChildEvent RequestRemoval(Thing thingToRemove) { // Create and raise a removal event request. var removeChildEvent = new RemoveChildEvent(thingToRemove); Eventing.OnMovementRequest(removeChildEvent, EventScope.SelfDown); return(removeChildEvent); }
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); }