コード例 #1
0
        internal SLMemberProperty Clone()
        {
            SLMemberProperty mp = new SLMemberProperty();

            mp.Name                 = this.Name;
            mp.ShowCell             = this.ShowCell;
            mp.ShowTip              = this.ShowTip;
            mp.ShowAsCaption        = this.ShowAsCaption;
            mp.NameLength           = this.NameLength;
            mp.PropertyNamePosition = this.PropertyNamePosition;
            mp.PropertyNameLength   = this.PropertyNameLength;
            mp.Level                = this.Level;
            mp.Field                = this.Field;

            return(mp);
        }
コード例 #2
0
        internal void FromPivotHierarchy(PivotHierarchy ph)
        {
            this.SetAllNull();

            if (ph.Outline != null)
            {
                this.Outline = ph.Outline.Value;
            }
            if (ph.MultipleItemSelectionAllowed != null)
            {
                this.Outline = ph.MultipleItemSelectionAllowed.Value;
            }
            if (ph.SubtotalTop != null)
            {
                this.SubtotalTop = ph.SubtotalTop.Value;
            }
            if (ph.ShowInFieldList != null)
            {
                this.ShowInFieldList = ph.ShowInFieldList.Value;
            }
            if (ph.DragToRow != null)
            {
                this.DragToRow = ph.DragToRow.Value;
            }
            if (ph.DragToColumn != null)
            {
                this.DragToColumn = ph.DragToColumn.Value;
            }
            if (ph.DragToPage != null)
            {
                this.DragToPage = ph.DragToPage.Value;
            }
            if (ph.DragToData != null)
            {
                this.DragToData = ph.DragToData.Value;
            }
            if (ph.DragOff != null)
            {
                this.DragOff = ph.DragOff.Value;
            }
            if (ph.IncludeNewItemsInFilter != null)
            {
                this.IncludeNewItemsInFilter = ph.IncludeNewItemsInFilter.Value;
            }
            if (ph.Caption != null)
            {
                this.Caption = ph.Caption.Value;
            }

            SLMemberProperty mp;
            SLMembers        mems;

            using (OpenXmlReader oxr = OpenXmlReader.Create(ph))
            {
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(MemberProperty))
                    {
                        mp = new SLMemberProperty();
                        mp.FromMemberProperty((MemberProperty)oxr.LoadCurrentElement());
                        this.MemberProperties.Add(mp);
                    }
                    else if (oxr.ElementType == typeof(Members))
                    {
                        mems = new SLMembers();
                        mems.FromMembers((Members)oxr.LoadCurrentElement());
                        this.Members.Add(mems);
                    }
                }
            }
        }