public CohortAggregateContainerCombineable(CohortAggregateContainer aggregateContainer)
        {
            AggregateContainer          = aggregateContainer;
            AllSubContainersRecursively = AggregateContainer.GetAllSubContainersRecursively();

            ParentContainerIfAny = AggregateContainer.GetParentContainerIfAny();
        }
Ejemplo n.º 2
0
        public ExecuteCommandReOrderAggregate(IActivateItems activator, AggregateConfigurationCombineable sourceAggregateCommand, CohortAggregateContainer targetCohortAggregateContainer, InsertOption insertOption) : this(activator, targetCohortAggregateContainer, insertOption)
        {
            _sourceAggregateCommand = sourceAggregateCommand;
            _parentContainer        = targetCohortAggregateContainer.GetParentContainerIfAny();

            if (!sourceAggregateCommand.ContainerIfAny.Equals(_parentContainer))
            {
                SetImpossible("Cannot ReOrder, you should first move both objects into the same container (UNION / EXCEPT / INTERSECT)");
                return;
            }
        }
        public ExecuteCommandReOrderAggregateContainer(IActivateItems activator, CohortAggregateContainerCombineable sourceCohortAggregateContainerCombineable, CohortAggregateContainer targetCohortAggregateContainer, InsertOption insertOption) : this(activator, targetCohortAggregateContainer, insertOption)
        {
            _sourceCohortAggregateContainerCombineable = sourceCohortAggregateContainerCombineable;

            _targetParent = targetCohortAggregateContainer.GetParentContainerIfAny();

            //reorder is only possible within a container
            if (!_sourceCohortAggregateContainerCombineable.ParentContainerIfAny.Equals(_targetParent))
            {
                SetImpossible("First move containers to share the same parent container");
            }

            if (_insertOption == InsertOption.Default)
            {
                SetImpossible("Insert must be above/below");
            }
        }