public void AddMemberAction(MemberAction Action)
        {
            if (Actions.Count > 0)
            {
                var lastAction = Actions[Actions.Count - 1];
                if (lastAction.TuplesAreEqual(Action))                 // THE SAME member сell
                {
                    // Два DrillDown подряд делать смысла нет (просто оставляем старый)
                    if ((lastAction is MemberActionDrillDown) && (Action is MemberActionDrillDown))
                    {
                        return;
                    }

                    //  Expand после Collapse просто отменяет Collapse
                    //  Collapse после Expand просто отменяет Expand
                    if (((lastAction is MemberActionExpand) && (Action is MemberActionCollapse)) ||
                        ((lastAction is MemberActionCollapse) && (Action is MemberActionExpand))
                        )
                    {
                        Actions.RemoveAt(Actions.Count - 1);
                        return;
                    }
                }
            }
            Actions.Add(Action);
        }
		public bool TuplesAreEqual(MemberAction Action)
		{
			if (Action == null)
				return false;

			if (args == null)
				return false;

			var args1 = Action.args;
			if (args1 == null)
				return false;

			if (args.Member.UniqueName != args1.Member.UniqueName)
				return false;

			var a = args.Ascendants;
			if (a == null)
				return false;

			var a1 = args1.Ascendants;
			if (a1 == null)
				return false;

			if (a.Count != a1.Count)
				return false;

			for (int i = 0; i < a.Count; i++)
			{
				var mi = a[i];
				var mi1 = a1[i];
				if (mi.UniqueName != mi1.UniqueName)
					return false;
			}
			return true;
		}
        public void AddMemberAction(int axisIndex, MemberAction Action)
        {
            AxisInfo ai = (axisIndex == 0) ^ RotateAxes
                         ? ColumnsActionChain
                         : RowsActionChain;

            ai.AddMemberAction(Action);
        }
Exemple #4
0
        public bool TuplesAreEqual(MemberAction Action)
        {
            if (Action == null)
            {
                return(false);
            }

            if (args == null)
            {
                return(false);
            }

            var args1 = Action.args;

            if (args1 == null)
            {
                return(false);
            }

            if (args.Member.UniqueName != args1.Member.UniqueName)
            {
                return(false);
            }

            var a = args.Ascendants;

            if (a == null)
            {
                return(false);
            }

            var a1 = args1.Ascendants;

            if (a1 == null)
            {
                return(false);
            }

            if (a.Count != a1.Count)
            {
                return(false);
            }

            for (int i = 0; i < a.Count; i++)
            {
                var mi  = a[i];
                var mi1 = a1[i];
                if (mi.UniqueName != mi1.UniqueName)
                {
                    return(false);
                }
            }
            return(true);
        }
		public void AddMemberAction(MemberAction Action)
		{
			if (Actions.Count > 0)
			{
				var lastAction = Actions[Actions.Count - 1];
				if (lastAction.TuplesAreEqual(Action)) // THE SAME member сell
				{
					// Два DrillDown подряд делать смысла нет (просто оставляем старый)
					if ((lastAction is MemberActionDrillDown) && (Action is MemberActionDrillDown))
						return;

					//  Expand после Collapse просто отменяет Collapse
					//  Collapse после Expand просто отменяет Expand
					if (((lastAction is MemberActionExpand) && (Action is MemberActionCollapse))
							|| ((lastAction is MemberActionCollapse) && (Action is MemberActionExpand))
							)
					{
						Actions.RemoveAt(Actions.Count - 1);
						return;
					}
				}
			}
			Actions.Add(Action);
		}