Ejemplo n.º 1
0
        //TODO make private
        public bool HasSelectionType(CommandIterator.SelectionType selectionType, string axis, string member)
        {
            if (selectionType == CommandIterator.SelectionType.Axis)
            {
                if (this.Segments == null || this.Segments.Count == 0)
                {
                    return(false);
                }

                Segment s = this.Segments.Find(seg => seg.DimensionInfo.dimensionId == axis);
                if (s == null)
                {
                    return(false);
                }

                if (member == "*")
                {
                    return(true);
                }

                return(s.DimensionInfo.Id == member);
            }
            else
            {
                return(this.HasSelectionType(selectionType));
            }
        }
Ejemplo n.º 2
0
        //TODO make private
        public CommandIterator.SelectionType GetSelections()
        {
            CommandIterator.SelectionType selections = CommandIterator.SelectionType.None;

            if (this.ElementRow != null)
            {
                selections |= CommandIterator.SelectionType.Element;
            }

            if (this.Period != null)
            {
                selections |= CommandIterator.SelectionType.Period;
            }

            if (this.Unit != null)
            {
                selections |= CommandIterator.SelectionType.Unit;
            }

            if (this.Segments != null && this.Segments.Count > 0)
            {
                selections |= CommandIterator.SelectionType.Axis;
            }

            return(selections);
        }
Ejemplo n.º 3
0
        //TODO make private
        public static CommandIterator.SelectionType GetIntersection(ColumnRowRequirement leftCol, ColumnRowRequirement rightCol)
        {
            if (leftCol == null || rightCol == null)
            {
                return(CommandIterator.SelectionType.None);
            }

            CommandIterator.SelectionType leftSelection  = leftCol.GetSelections();
            CommandIterator.SelectionType rightSelection = rightCol.GetSelections();
            CommandIterator.SelectionType intersection   = leftSelection & rightSelection;
            return(intersection);
        }
Ejemplo n.º 4
0
        public bool HasSelectionType(CommandIterator.SelectionType selectionType)
        {
            switch (selectionType)
            {
            case CommandIterator.SelectionType.Axis:
                throw new NotSupportedException("SelectionType: Axis is not supported by this form of the method.");

            case CommandIterator.SelectionType.Element:
                return(this.ElementRow != null);

            case CommandIterator.SelectionType.Period:
                return(this.Period != null);

            case CommandIterator.SelectionType.Unit:
                return(this.Unit != null);
            }

            return(false);
        }