コード例 #1
0
        public Member ReplaceMember(Member toReplace, Member replaceWith)
        {
            if (toReplace == null || replaceWith == null)
            {
                throw new ArgumentNullException();
            }
            if (toReplace == replaceWith)
            {
                return(toReplace);
            }

            CalculatedMember calcToReplace = toReplace as CalculatedMember;
            int existIndex = (calcToReplace != null ? this.CalculatedMembers.IndexOf(calcToReplace.UniqueName) : this.DataMembers.IndexOf(toReplace.UniqueName));

            // this might be one of nested members
            if (existIndex < 0)
            {
                // this might be one of nested members
                if (calcToReplace != null)
                {
                    return(this.CalculatedMembers.ReplaceParameterMember(calcToReplace, replaceWith));
                }

                return(null);
            }

            if (calcToReplace != null)
            {
                this.CalculatedMembers.RemoveAt(existIndex);
            }
            else
            {
                this.DataMembers.RemoveAt(existIndex);
            }

            try
            {
                this.AddMember(replaceWith, false);                 //add new member
            }
            catch (Exception exc)
            {
                // rollback in case of error
                if (existIndex >= 0)
                {
                    if (calcToReplace != null)
                    {
                        this.CalculatedMembers.Insert(existIndex, calcToReplace, false);
                    }
                    else
                    {
                        this.DataMembers.Insert(existIndex, toReplace, false);
                    }
                }

                throw exc;
            }

            return(replaceWith);
        }
コード例 #2
0
 internal SchemaMember(Hierarchy hier, CalculatedMember ParentCalcMember) : base(hier)
 {
     this._uniqueName = ParentCalcMember.UniqueName;
     this._name       = ParentCalcMember.Name;
     this._childCount = ParentCalcMember.ChildCount;
     this._levelDepth = ParentCalcMember.LevelDepth;
     //this._isVisible=SrcMem.IsVisible;
 }
コード例 #3
0
        public void Insert(int Index, CalculatedMember Member, bool replaceExisting)
        {
            if (Member.Hierarchy != this.Hierarchy)
            {
                throw new ArgumentException("Hierarchy mismatch");
            }

            base.Insert(Index, Member, replaceExisting);
        }
コード例 #4
0
        public void RemoveMember(Member mem)
        {
            CalculatedMember cmem = mem as CalculatedMember;

            if (cmem != null)
            {
                this.CalculatedMembers.Remove(cmem.UniqueName);
            }
            else
            {
                this.DataMembers.Remove(mem.UniqueName);
            }
        }
コード例 #5
0
        public void AddMember(Member mem, bool replaceExisting)
        {
            CalculatedMember cmem = mem as CalculatedMember;

            if (cmem != null)
            {
                this.CalculatedMembers.Add(cmem, replaceExisting);
            }
            else
            {
                this.DataMembers.Add(mem, replaceExisting);
            }
        }
コード例 #6
0
        private void AddParameterInput(CalculatedMember cmem)
        {
            HtmlTableRow row=new HtmlTableRow();
            this.paramsTable.Rows.Add(row);

            FilteredByNameSet filtLevSet=cmem as FilteredByNameSet;
            if(filtLevSet!=null)
            {
                HtmlTableCell cell=new HtmlTableCell();
                row.Cells.Add(cell);

                CalculatedMemberControls.FilteredByNameSetControl control=(CalculatedMemberControls.FilteredByNameSetControl)Page.LoadControl(Request.ApplicationPath + "/OlapReport/CalculatedMemberControls/FilteredByNameSetControl.ascx");
                control._filtByNameSet=filtLevSet;
                cell.Controls.Add(control);
            }
        }
コード例 #7
0
        public ArrayList GetPromptMembers()
        {
            ArrayList list = new ArrayList();

            if (this.Prompt)
            {
                list.Add(this);
            }

            foreach (Object obj in this._mdxParameters)
            {
                CalculatedMember cmem = obj as CalculatedMember;
                if (cmem != null)
                {
                    list.AddRange(cmem.GetPromptMembers());
                }
            }

            return(list);
        }
コード例 #8
0
        public Member ReplaceParameterMember(Member toReplace, Member replaceWith)
        {
            for (int i = 0; i < _mdxParameters.Count; i++)
            {
                Object obj = _mdxParameters[i];
                if (toReplace == obj)
                {
                    return((Member)_mdxParameters.ReplaceAtIndex(i, replaceWith));
                }

                // --
                CalculatedMember cmem = obj as CalculatedMember;
                if (cmem != null)
                {
                    Member ret = cmem.ReplaceParameterMember(toReplace, replaceWith);
                    if (ret != null)
                    {
                        return(ret);
                    }
                }
            }

            return(null);
        }
コード例 #9
0
        public void Insert(int Index, CalculatedMember Member, bool replaceExisting)
        {
            if(Member.Hierarchy!=this.Hierarchy)
                throw new ArgumentException("Hierarchy mismatch");

            base.Insert (Index, Member, replaceExisting);
        }
コード例 #10
0
 public void Add(CalculatedMember Member, bool replaceExisting)
 {
     base.Add(Member, true);
 }
コード例 #11
0
 public void Add(CalculatedMember Member, bool replaceExisting)
 {
     base.Add(Member, true);
 }