Ejemplo n.º 1
0
        /// <inheritdoc/>
        public bool ShouldBeEnabled(AggregateEditorSection section, AggregateConfiguration aggregate)
        {
            switch (section)
            {
            case AggregateEditorSection.Extractable:
                return(false);

            case AggregateEditorSection.TOPX:
                return(false);

            case AggregateEditorSection.PIVOT:
                return(false);

            case AggregateEditorSection.AXIS:
                return(false);

            default:
                throw new ArgumentOutOfRangeException("section");
            }
        }
        /// <inheritdoc/>
        public bool ShouldBeEnabled(AggregateEditorSection section, AggregateConfiguration aggregate)
        {
            switch (section)
            {
            case AggregateEditorSection.Extractable:
                return(CanMakeExtractable(aggregate));

            case AggregateEditorSection.TOPX:
                //can only Top X if we have a pivot (top x applies to the selection of the pivot values) or if we have nothing (no axis / pivot).  This rules out axis only queries
                return(aggregate.PivotOnDimensionID != null || aggregate.GetAxisIfAny() == null);

            case AggregateEditorSection.PIVOT:
                return(aggregate.GetAxisIfAny() != null || aggregate.AggregateDimensions.Length == 2); //can only pivot if there is an axis or exactly 2 dimensions (+ count)

            case AggregateEditorSection.AXIS:
                return(true);

            default:
                throw new ArgumentOutOfRangeException("section");
            }
        }