Example #1
0
        private void SetAllNull()
        {
            this.HasTuples = false;
            this.Tuples = new SLTuplesType();

            this.Mdx = "";
        }
        internal SLTuplesType Clone()
        {
            SLTuplesType tt = new SLTuplesType();
            tt.MemberNameCount = this.MemberNameCount;

            tt.Tuples = new List<SLTuple>();
            foreach (SLTuple t in this.Tuples)
            {
                tt.Tuples.Add(t.Clone());
            }

            return tt;
        }
Example #3
0
        internal SLTuplesType Clone()
        {
            SLTuplesType tt = new SLTuplesType();

            tt.MemberNameCount = this.MemberNameCount;

            tt.Tuples = new List <SLTuple>();
            foreach (SLTuple t in this.Tuples)
            {
                tt.Tuples.Add(t.Clone());
            }

            return(tt);
        }
Example #4
0
        internal void FromTupleSet(TupleSet ts)
        {
            this.SetAllNull();

            if (ts.MaxRank != null)
            {
                this.MaxRank = ts.MaxRank.Value;
            }
            if (ts.SetDefinition != null)
            {
                this.SetDefinition = ts.SetDefinition.Value;
            }
            if (ts.SortType != null)
            {
                this.SortType = ts.SortType.Value;
            }
            if (ts.QueryFailed != null)
            {
                this.QueryFailed = ts.QueryFailed.Value;
            }

            SLTuplesType tt;

            using (OpenXmlReader oxr = OpenXmlReader.Create(ts))
            {
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(Tuples))
                    {
                        tt = new SLTuplesType();
                        tt.FromTuples((Tuples)oxr.LoadCurrentElement());
                        this.Tuples.Add(tt);
                    }
                    else if (oxr.ElementType == typeof(SortByTuple))
                    {
                        this.SortByTuple.FromSortByTuple((SortByTuple)oxr.LoadCurrentElement());
                        this.HasSortByTuple = true;
                    }
                }
            }
        }
Example #5
0
        internal void FromNumberItem(NumberItem ni)
        {
            this.SetAllNull();

            if (ni.Val != null)
            {
                this.Val = ni.Val.Value;
            }
            if (ni.Unused != null)
            {
                this.Unused = ni.Unused.Value;
            }
            if (ni.Calculated != null)
            {
                this.Calculated = ni.Calculated.Value;
            }
            if (ni.Caption != null)
            {
                this.Caption = ni.Caption.Value;
            }
            if (ni.PropertyCount != null)
            {
                this.PropertyCount = ni.PropertyCount.Value;
            }
            if (ni.FormatIndex != null)
            {
                this.FormatIndex = ni.FormatIndex.Value;
            }
            if (ni.BackgroundColor != null)
            {
                this.BackgroundColor = ni.BackgroundColor.Value;
            }
            if (ni.ForegroundColor != null)
            {
                this.ForegroundColor = ni.ForegroundColor.Value;
            }
            if (ni.Italic != null)
            {
                this.Italic = ni.Italic.Value;
            }
            if (ni.Underline != null)
            {
                this.Underline = ni.Underline.Value;
            }
            if (ni.Strikethrough != null)
            {
                this.Strikethrough = ni.Strikethrough.Value;
            }
            if (ni.Bold != null)
            {
                this.Bold = ni.Bold.Value;
            }

            SLTuplesType        tt;
            MemberPropertyIndex mpi;

            using (OpenXmlReader oxr = OpenXmlReader.Create(ni))
            {
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(Tuples))
                    {
                        tt = new SLTuplesType();
                        tt.FromTuples((Tuples)oxr.LoadCurrentElement());
                        this.Tuples.Add(tt);
                    }
                    else if (oxr.ElementType == typeof(MemberPropertyIndex))
                    {
                        // 0 is the default value.
                        mpi = (MemberPropertyIndex)oxr.LoadCurrentElement();
                        if (mpi.Val != null)
                        {
                            this.MemberPropertyIndexes.Add(mpi.Val.Value);
                        }
                        else
                        {
                            this.MemberPropertyIndexes.Add(0);
                        }
                    }
                }
            }
        }
        internal void FromErrorItem(ErrorItem ei)
        {
            this.SetAllNull();

            if (ei.Val != null) this.Val = ei.Val.Value;
            if (ei.Unused != null) this.Unused = ei.Unused.Value;
            if (ei.Calculated != null) this.Calculated = ei.Calculated.Value;
            if (ei.Caption != null) this.Caption = ei.Caption.Value;
            if (ei.PropertyCount != null) this.PropertyCount = ei.PropertyCount.Value;
            if (ei.FormatIndex != null) this.FormatIndex = ei.FormatIndex.Value;
            if (ei.BackgroundColor != null) this.BackgroundColor = ei.BackgroundColor.Value;
            if (ei.ForegroundColor != null) this.ForegroundColor = ei.ForegroundColor.Value;
            if (ei.Italic != null) this.Italic = ei.Italic.Value;
            if (ei.Underline != null) this.Underline = ei.Underline.Value;
            if (ei.Strikethrough != null) this.Strikethrough = ei.Strikethrough.Value;
            if (ei.Bold != null) this.Bold = ei.Bold.Value;

            SLTuplesType tt;
            MemberPropertyIndex mpi;
            using (OpenXmlReader oxr = OpenXmlReader.Create(ei))
            {
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(Tuples))
                    {
                        tt = new SLTuplesType();
                        tt.FromTuples((Tuples)oxr.LoadCurrentElement());
                        this.Tuples.Add(tt);
                    }
                    else if (oxr.ElementType == typeof(MemberPropertyIndex))
                    {
                        // 0 is the default value.
                        mpi = (MemberPropertyIndex)oxr.LoadCurrentElement();
                        if (mpi.Val != null) this.MemberPropertyIndexes.Add(mpi.Val.Value);
                        else this.MemberPropertyIndexes.Add(0);
                    }
                }
            }
        }
Example #7
0
        internal void FromTupleSet(TupleSet ts)
        {
            this.SetAllNull();

            if (ts.MaxRank != null) this.MaxRank = ts.MaxRank.Value;
            if (ts.SetDefinition != null) this.SetDefinition = ts.SetDefinition.Value;
            if (ts.SortType != null) this.SortType = ts.SortType.Value;
            if (ts.QueryFailed != null) this.QueryFailed = ts.QueryFailed.Value;

            SLTuplesType tt;
            using (OpenXmlReader oxr = OpenXmlReader.Create(ts))
            {
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(Tuples))
                    {
                        tt = new SLTuplesType();
                        tt.FromTuples((Tuples)oxr.LoadCurrentElement());
                        this.Tuples.Add(tt);
                    }
                    else if (oxr.ElementType == typeof(SortByTuple))
                    {
                        this.SortByTuple.FromSortByTuple((SortByTuple)oxr.LoadCurrentElement());
                        this.HasSortByTuple = true;
                    }
                }
            }
        }