public ExecuteCommandReOrderAggregateContainer(IActivateItems activator, CohortAggregateContainerCommand sourceCohortAggregateContainerCommand, AggregateConfiguration targetAggregate, InsertOption insertOption) : this(activator, targetAggregate, insertOption) { _sourceCohortAggregateContainerCommand = sourceCohortAggregateContainerCommand; _targetParent = targetAggregate.GetCohortAggregateContainerIfAny(); //if they do not share the same parent container if (!_sourceCohortAggregateContainerCommand.ParentContainerIfAny.Equals(_targetParent)) { SetImpossible("First move objects into the same parent container"); } }
public ExecuteCommandMoveCohortAggregateContainerIntoSubContainer(IActivateItems activator, CohortAggregateContainerCommand sourceCohortAggregateContainer, CohortAggregateContainer targetCohortAggregateContainer) : base(activator) { _sourceCohortAggregateContainer = sourceCohortAggregateContainer; _targetCohortAggregateContainer = targetCohortAggregateContainer; if (_sourceCohortAggregateContainer.AllSubContainersRecursively.Contains(_targetCohortAggregateContainer)) { SetImpossible("Cannot move a container into one of it's own subcontainers"); } if (_sourceCohortAggregateContainer.AggregateContainer.Equals(_targetCohortAggregateContainer)) { SetImpossible("Cannot move a container into itself"); } }
public ExecuteCommandReOrderAggregateContainer(IActivateItems activator, CohortAggregateContainerCommand sourceCohortAggregateContainerCommand, CohortAggregateContainer targetCohortAggregateContainer, InsertOption insertOption) : this(activator, targetCohortAggregateContainer, insertOption) { _sourceCohortAggregateContainerCommand = sourceCohortAggregateContainerCommand; _targetParent = targetCohortAggregateContainer.GetParentContainerIfAny(); //reorder is only possible within a container if (!_sourceCohortAggregateContainerCommand.ParentContainerIfAny.Equals(_targetParent)) { SetImpossible("First move containers to share the same parent container"); } if (_insertOption == InsertOption.Default) { SetImpossible("Insert must be above/below"); } }