internal SLStringItem Clone()
        {
            SLStringItem si = new SLStringItem();
            si.Val = this.Val;
            si.Unused = this.Unused;
            si.Calculated = this.Calculated;
            si.Caption = this.Caption;
            si.PropertyCount = this.PropertyCount;
            si.FormatIndex = this.FormatIndex;
            si.BackgroundColor = this.BackgroundColor;
            si.ForegroundColor = this.ForegroundColor;
            si.Italic = this.Italic;
            si.Underline = this.Underline;
            si.Strikethrough = this.Strikethrough;
            si.Bold = this.Bold;

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

            si.MemberPropertyIndexes = new List<int>();
            foreach (int i in this.MemberPropertyIndexes)
            {
                si.MemberPropertyIndexes.Add(i);
            }

            return si;
        }
Ejemplo n.º 2
0
        internal void FromEntries(Entries es)
        {
            this.SetAllNull();

            SLMissingItem mi;
            SLNumberItem  ni;
            SLErrorItem   ei;
            SLStringItem  si;

            using (OpenXmlReader oxr = OpenXmlReader.Create(es))
            {
                while (oxr.Read())
                {
                    // make sure to add to Items first, because of the Count thing.
                    if (oxr.ElementType == typeof(MissingItem))
                    {
                        mi = new SLMissingItem();
                        mi.FromMissingItem((MissingItem)oxr.LoadCurrentElement());
                        this.Items.Add(new SLEntriesItemsTypeIndexPair(SLEntriesItemsType.Missing, this.MissingItems.Count));
                        this.MissingItems.Add(mi);
                    }
                    else if (oxr.ElementType == typeof(NumberItem))
                    {
                        ni = new SLNumberItem();
                        ni.FromNumberItem((NumberItem)oxr.LoadCurrentElement());
                        this.Items.Add(new SLEntriesItemsTypeIndexPair(SLEntriesItemsType.Number, this.NumberItems.Count));
                        this.NumberItems.Add(ni);
                    }
                    else if (oxr.ElementType == typeof(ErrorItem))
                    {
                        ei = new SLErrorItem();
                        ei.FromErrorItem((ErrorItem)oxr.LoadCurrentElement());
                        this.Items.Add(new SLEntriesItemsTypeIndexPair(SLEntriesItemsType.Error, this.ErrorItems.Count));
                        this.ErrorItems.Add(ei);
                    }
                    else if (oxr.ElementType == typeof(StringItem))
                    {
                        si = new SLStringItem();
                        si.FromStringItem((StringItem)oxr.LoadCurrentElement());
                        this.Items.Add(new SLEntriesItemsTypeIndexPair(SLEntriesItemsType.String, this.StringItems.Count));
                        this.StringItems.Add(si);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        internal void FromGroupItems(GroupItems gis)
        {
            this.SetAllNull();

            SLMissingItem  mi;
            SLNumberItem   ni;
            SLBooleanItem  bi;
            SLErrorItem    ei;
            SLStringItem   si;
            SLDateTimeItem dti;

            using (OpenXmlReader oxr = OpenXmlReader.Create(gis))
            {
                while (oxr.Read())
                {
                    // make sure to add to Items first, because of the Count thing.
                    if (oxr.ElementType == typeof(MissingItem))
                    {
                        mi = new SLMissingItem();
                        mi.FromMissingItem((MissingItem)oxr.LoadCurrentElement());
                        this.Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Missing, this.MissingItems.Count));
                        this.MissingItems.Add(mi);
                    }
                    else if (oxr.ElementType == typeof(NumberItem))
                    {
                        ni = new SLNumberItem();
                        ni.FromNumberItem((NumberItem)oxr.LoadCurrentElement());
                        this.Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Number, this.NumberItems.Count));
                        this.NumberItems.Add(ni);
                    }
                    else if (oxr.ElementType == typeof(BooleanItem))
                    {
                        bi = new SLBooleanItem();
                        bi.FromBooleanItem((BooleanItem)oxr.LoadCurrentElement());
                        this.Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Boolean, this.BooleanItems.Count));
                        this.BooleanItems.Add(bi);
                    }
                    else if (oxr.ElementType == typeof(ErrorItem))
                    {
                        ei = new SLErrorItem();
                        ei.FromErrorItem((ErrorItem)oxr.LoadCurrentElement());
                        this.Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Error, this.ErrorItems.Count));
                        this.ErrorItems.Add(ei);
                    }
                    else if (oxr.ElementType == typeof(StringItem))
                    {
                        si = new SLStringItem();
                        si.FromStringItem((StringItem)oxr.LoadCurrentElement());
                        this.Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.String, this.StringItems.Count));
                        this.StringItems.Add(si);
                    }
                    else if (oxr.ElementType == typeof(DateTimeItem))
                    {
                        dti = new SLDateTimeItem();
                        dti.FromDateTimeItem((DateTimeItem)oxr.LoadCurrentElement());
                        this.Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.DateTime, this.DateTimeItems.Count));
                        this.DateTimeItems.Add(dti);
                    }
                }
            }
        }
        internal void FromSharedItems(SharedItems sis)
        {
            this.SetAllNull();

            if (sis.ContainsSemiMixedTypes != null)
            {
                this.ContainsSemiMixedTypes = sis.ContainsSemiMixedTypes.Value;
            }
            if (sis.ContainsNonDate != null)
            {
                this.ContainsNonDate = sis.ContainsNonDate.Value;
            }
            if (sis.ContainsDate != null)
            {
                this.ContainsDate = sis.ContainsDate.Value;
            }
            if (sis.ContainsString != null)
            {
                this.ContainsString = sis.ContainsString.Value;
            }
            if (sis.ContainsBlank != null)
            {
                this.ContainsBlank = sis.ContainsBlank.Value;
            }
            if (sis.ContainsMixedTypes != null)
            {
                this.ContainsMixedTypes = sis.ContainsMixedTypes.Value;
            }
            if (sis.ContainsNumber != null)
            {
                this.ContainsNumber = sis.ContainsNumber.Value;
            }
            if (sis.ContainsInteger != null)
            {
                this.ContainsInteger = sis.ContainsInteger.Value;
            }
            if (sis.MinValue != null)
            {
                this.MinValue = sis.MinValue.Value;
            }
            if (sis.MaxValue != null)
            {
                this.MaxValue = sis.MaxValue.Value;
            }
            if (sis.MinDate != null)
            {
                this.MinDate = sis.MinDate.Value;
            }
            if (sis.MaxDate != null)
            {
                this.MaxDate = sis.MaxDate.Value;
            }
            //count
            if (sis.LongText != null)
            {
                this.LongText = sis.LongText.Value;
            }

            SLMissingItem  mi;
            SLNumberItem   ni;
            SLBooleanItem  bi;
            SLErrorItem    ei;
            SLStringItem   si;
            SLDateTimeItem dti;

            using (OpenXmlReader oxr = OpenXmlReader.Create(sis))
            {
                while (oxr.Read())
                {
                    // make sure to add to Items first, because of the Count thing.
                    if (oxr.ElementType == typeof(MissingItem))
                    {
                        mi = new SLMissingItem();
                        mi.FromMissingItem((MissingItem)oxr.LoadCurrentElement());
                        this.Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Missing, this.MissingItems.Count));
                        this.MissingItems.Add(mi);
                    }
                    else if (oxr.ElementType == typeof(NumberItem))
                    {
                        ni = new SLNumberItem();
                        ni.FromNumberItem((NumberItem)oxr.LoadCurrentElement());
                        this.Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Number, this.NumberItems.Count));
                        this.NumberItems.Add(ni);
                    }
                    else if (oxr.ElementType == typeof(BooleanItem))
                    {
                        bi = new SLBooleanItem();
                        bi.FromBooleanItem((BooleanItem)oxr.LoadCurrentElement());
                        this.Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Boolean, this.BooleanItems.Count));
                        this.BooleanItems.Add(bi);
                    }
                    else if (oxr.ElementType == typeof(ErrorItem))
                    {
                        ei = new SLErrorItem();
                        ei.FromErrorItem((ErrorItem)oxr.LoadCurrentElement());
                        this.Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Error, this.ErrorItems.Count));
                        this.ErrorItems.Add(ei);
                    }
                    else if (oxr.ElementType == typeof(StringItem))
                    {
                        si = new SLStringItem();
                        si.FromStringItem((StringItem)oxr.LoadCurrentElement());
                        this.Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.String, this.StringItems.Count));
                        this.StringItems.Add(si);
                    }
                    else if (oxr.ElementType == typeof(DateTimeItem))
                    {
                        dti = new SLDateTimeItem();
                        dti.FromDateTimeItem((DateTimeItem)oxr.LoadCurrentElement());
                        this.Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.DateTime, this.DateTimeItems.Count));
                        this.DateTimeItems.Add(dti);
                    }
                }
            }
        }