internal void FromEntries(Entries es) { SetAllNull(); SLMissingItem mi; SLNumberItem ni; SLErrorItem ei; SLStringItem si; using (var oxr = OpenXmlReader.Create(es)) { while (oxr.Read()) { if (oxr.ElementType == typeof(MissingItem)) { mi = new SLMissingItem(); mi.FromMissingItem((MissingItem)oxr.LoadCurrentElement()); Items.Add(new SLEntriesItemsTypeIndexPair(SLEntriesItemsType.Missing, MissingItems.Count)); MissingItems.Add(mi); } else if (oxr.ElementType == typeof(NumberItem)) { ni = new SLNumberItem(); ni.FromNumberItem((NumberItem)oxr.LoadCurrentElement()); Items.Add(new SLEntriesItemsTypeIndexPair(SLEntriesItemsType.Number, NumberItems.Count)); NumberItems.Add(ni); } else if (oxr.ElementType == typeof(ErrorItem)) { ei = new SLErrorItem(); ei.FromErrorItem((ErrorItem)oxr.LoadCurrentElement()); Items.Add(new SLEntriesItemsTypeIndexPair(SLEntriesItemsType.Error, ErrorItems.Count)); ErrorItems.Add(ei); } else if (oxr.ElementType == typeof(StringItem)) { si = new SLStringItem(); si.FromStringItem((StringItem)oxr.LoadCurrentElement()); Items.Add(new SLEntriesItemsTypeIndexPair(SLEntriesItemsType.String, StringItems.Count)); StringItems.Add(si); } } } }
internal void FromGroupItems(GroupItems gis) { SetAllNull(); SLMissingItem mi; SLNumberItem ni; SLBooleanItem bi; SLErrorItem ei; SLStringItem si; SLDateTimeItem dti; using (var oxr = OpenXmlReader.Create(gis)) { while (oxr.Read()) { if (oxr.ElementType == typeof(MissingItem)) { mi = new SLMissingItem(); mi.FromMissingItem((MissingItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Missing, MissingItems.Count)); MissingItems.Add(mi); } else if (oxr.ElementType == typeof(NumberItem)) { ni = new SLNumberItem(); ni.FromNumberItem((NumberItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Number, NumberItems.Count)); NumberItems.Add(ni); } else if (oxr.ElementType == typeof(BooleanItem)) { bi = new SLBooleanItem(); bi.FromBooleanItem((BooleanItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Boolean, BooleanItems.Count)); BooleanItems.Add(bi); } else if (oxr.ElementType == typeof(ErrorItem)) { ei = new SLErrorItem(); ei.FromErrorItem((ErrorItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Error, ErrorItems.Count)); ErrorItems.Add(ei); } else if (oxr.ElementType == typeof(StringItem)) { si = new SLStringItem(); si.FromStringItem((StringItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.String, StringItems.Count)); StringItems.Add(si); } else if (oxr.ElementType == typeof(DateTimeItem)) { dti = new SLDateTimeItem(); dti.FromDateTimeItem((DateTimeItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.DateTime, DateTimeItems.Count)); DateTimeItems.Add(dti); } } } }
internal void FromSharedItems(SharedItems sis) { SetAllNull(); if (sis.ContainsSemiMixedTypes != null) { ContainsSemiMixedTypes = sis.ContainsSemiMixedTypes.Value; } if (sis.ContainsNonDate != null) { ContainsNonDate = sis.ContainsNonDate.Value; } if (sis.ContainsDate != null) { ContainsDate = sis.ContainsDate.Value; } if (sis.ContainsString != null) { ContainsString = sis.ContainsString.Value; } if (sis.ContainsBlank != null) { ContainsBlank = sis.ContainsBlank.Value; } if (sis.ContainsMixedTypes != null) { ContainsMixedTypes = sis.ContainsMixedTypes.Value; } if (sis.ContainsNumber != null) { ContainsNumber = sis.ContainsNumber.Value; } if (sis.ContainsInteger != null) { ContainsInteger = sis.ContainsInteger.Value; } if (sis.MinValue != null) { MinValue = sis.MinValue.Value; } if (sis.MaxValue != null) { MaxValue = sis.MaxValue.Value; } if (sis.MinDate != null) { MinDate = sis.MinDate.Value; } if (sis.MaxDate != null) { MaxDate = sis.MaxDate.Value; } //count if (sis.LongText != null) { LongText = sis.LongText.Value; } SLMissingItem mi; SLNumberItem ni; SLBooleanItem bi; SLErrorItem ei; SLStringItem si; SLDateTimeItem dti; using (var oxr = OpenXmlReader.Create(sis)) { while (oxr.Read()) { if (oxr.ElementType == typeof(MissingItem)) { mi = new SLMissingItem(); mi.FromMissingItem((MissingItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Missing, MissingItems.Count)); MissingItems.Add(mi); } else if (oxr.ElementType == typeof(NumberItem)) { ni = new SLNumberItem(); ni.FromNumberItem((NumberItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Number, NumberItems.Count)); NumberItems.Add(ni); } else if (oxr.ElementType == typeof(BooleanItem)) { bi = new SLBooleanItem(); bi.FromBooleanItem((BooleanItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Boolean, BooleanItems.Count)); BooleanItems.Add(bi); } else if (oxr.ElementType == typeof(ErrorItem)) { ei = new SLErrorItem(); ei.FromErrorItem((ErrorItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Error, ErrorItems.Count)); ErrorItems.Add(ei); } else if (oxr.ElementType == typeof(StringItem)) { si = new SLStringItem(); si.FromStringItem((StringItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.String, StringItems.Count)); StringItems.Add(si); } else if (oxr.ElementType == typeof(DateTimeItem)) { dti = new SLDateTimeItem(); dti.FromDateTimeItem((DateTimeItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.DateTime, DateTimeItems.Count)); DateTimeItems.Add(dti); } } } }
internal void FromPivotCacheRecord(PivotCacheRecord pcr) { SetAllNull(); SLMissingItem mi; SLNumberItem ni; SLBooleanItem bi; SLErrorItem ei; SLStringItem si; SLDateTimeItem dti; FieldItem fi; using (var oxr = OpenXmlReader.Create(pcr)) { while (oxr.Read()) { if (oxr.ElementType == typeof(MissingItem)) { mi = new SLMissingItem(); mi.FromMissingItem((MissingItem)oxr.LoadCurrentElement()); Items.Add(new SLPivotCacheRecordItemsTypeIndexPair(SLPivotCacheRecordItemsType.Missing, MissingItems.Count)); MissingItems.Add(mi); } else if (oxr.ElementType == typeof(NumberItem)) { ni = new SLNumberItem(); ni.FromNumberItem((NumberItem)oxr.LoadCurrentElement()); Items.Add(new SLPivotCacheRecordItemsTypeIndexPair(SLPivotCacheRecordItemsType.Number, NumberItems.Count)); NumberItems.Add(ni); } else if (oxr.ElementType == typeof(BooleanItem)) { bi = new SLBooleanItem(); bi.FromBooleanItem((BooleanItem)oxr.LoadCurrentElement()); Items.Add(new SLPivotCacheRecordItemsTypeIndexPair(SLPivotCacheRecordItemsType.Boolean, BooleanItems.Count)); BooleanItems.Add(bi); } else if (oxr.ElementType == typeof(ErrorItem)) { ei = new SLErrorItem(); ei.FromErrorItem((ErrorItem)oxr.LoadCurrentElement()); Items.Add(new SLPivotCacheRecordItemsTypeIndexPair(SLPivotCacheRecordItemsType.Error, ErrorItems.Count)); ErrorItems.Add(ei); } else if (oxr.ElementType == typeof(StringItem)) { si = new SLStringItem(); si.FromStringItem((StringItem)oxr.LoadCurrentElement()); Items.Add(new SLPivotCacheRecordItemsTypeIndexPair(SLPivotCacheRecordItemsType.String, StringItems.Count)); StringItems.Add(si); } else if (oxr.ElementType == typeof(DateTimeItem)) { dti = new SLDateTimeItem(); dti.FromDateTimeItem((DateTimeItem)oxr.LoadCurrentElement()); Items.Add(new SLPivotCacheRecordItemsTypeIndexPair(SLPivotCacheRecordItemsType.DateTime, DateTimeItems.Count)); DateTimeItems.Add(dti); } else if (oxr.ElementType == typeof(FieldItem)) { fi = (FieldItem)oxr.LoadCurrentElement(); Items.Add(new SLPivotCacheRecordItemsTypeIndexPair(SLPivotCacheRecordItemsType.Field, FieldItems.Count)); FieldItems.Add(fi.Val.Value); } } } }