private void CreateExtracts(XmlReader reader, ExtractCollection extracts) { if (null == reader) throw new ArgumentNullException("reader"); if (null == extracts) throw new ArgumentNullException("extracts"); if (0 != string.Compare("Extracts", reader.Name, StringComparison.Ordinal)) throw new TrackingProfileDeserializationException(ExecutionStringManager.TrackingDeserializationInvalidPosition + "Extracts"); if (reader.IsEmptyElement) return; while (reader.Read()) { switch (reader.NodeType) { case XmlNodeType.Element: if (0 == string.Compare(reader.Name, "ActivityDataTrackingExtract", StringComparison.Ordinal)) { ActivityDataTrackingExtract e = new ActivityDataTrackingExtract(); CreateExtract(reader, e); extracts.Add(e); } else if (0 == string.Compare(reader.Name, "WorkflowDataTrackingExtract", StringComparison.Ordinal)) { WorkflowDataTrackingExtract e = new WorkflowDataTrackingExtract(); CreateExtract(reader, e); extracts.Add(e); } // // Xsd validation will catch unknown elements break; case XmlNodeType.EndElement: if (0 == string.Compare(reader.Name, "Extracts", StringComparison.Ordinal)) return; break; } } // // Only valid exit is on an EndElement that matches the element that is passed in. throw new TrackingProfileDeserializationException(ExecutionStringManager.TrackingDeserializationCloseElementNotFound + "Extracts."); }
private void CreateExtracts(XmlReader reader, ExtractCollection extracts) { if (reader == null) { throw new ArgumentNullException("reader"); } if (extracts == null) { throw new ArgumentNullException("extracts"); } if (string.Compare("Extracts", reader.Name, StringComparison.Ordinal) != 0) { throw new TrackingProfileDeserializationException(ExecutionStringManager.TrackingDeserializationInvalidPosition + "Extracts"); } if (!reader.IsEmptyElement) { while (true) { if (!reader.Read()) { throw new TrackingProfileDeserializationException(ExecutionStringManager.TrackingDeserializationCloseElementNotFound + "Extracts."); } switch (reader.NodeType) { case XmlNodeType.Element: if (string.Compare(reader.Name, "ActivityDataTrackingExtract", StringComparison.Ordinal) == 0) { ActivityDataTrackingExtract extract = new ActivityDataTrackingExtract(); this.CreateExtract(reader, extract); extracts.Add(extract); } else if (string.Compare(reader.Name, "WorkflowDataTrackingExtract", StringComparison.Ordinal) == 0) { WorkflowDataTrackingExtract extract2 = new WorkflowDataTrackingExtract(); this.CreateExtract(reader, extract2); extracts.Add(extract2); } break; case XmlNodeType.EndElement: if (string.Compare(reader.Name, "Extracts", StringComparison.Ordinal) == 0) { return; } break; } } } }