public int GetValues(object[] values) { if (values == null) { throw new ArgumentNullException("values"); } int num = Math.Min(values.Length, this.FieldCount); for (int i = 0; i < num; i++) { if (this.sequentialAccess && this.nestedDataReaders[i] != null) { this.currentColumn = i + 1; XmlaDataReader xmlaDataReader = new XmlaDataReader(this, this.nestedDataReaders[i]); xmlaDataReader.currentParentRow = this.dtStore.Rows.Count; while (xmlaDataReader.InternalRead()) { } values[i] = xmlaDataReader; } else { values[i] = this.GetValue(i); if (this.sequentialAccess && values[i] is ColumnXmlReader) { values[i] = new ColumnXmlReader(values[i].ToString()); } } } return(num); }
private object ReadColumnValue(int ordinal) { //Type type = FormattersHelpers.GetElementType(this.xmlReader, "http://www.w3.org/2001/XMLSchema-instance", null); Type type = FormattersHelpers.GetElementType(this.xmlReader, "http://www.w3.org/2001/XMLSchema-instance", typeof(object)); if (type == null) { type = this.GetFieldType(ordinal); } XmlaDataReader xmlaDataReader = this.nestedDataReaders[ordinal]; object obj; if (xmlaDataReader == null) { string columnXsdTypeName = FormattersHelpers.GetColumnXsdTypeName(this.dtStore.Columns[ordinal]); bool flag = columnXsdTypeName == "xmlDocument"; bool isArray = type.IsArray && columnXsdTypeName != "base64Binary"; if (!this.sequentialAccess) { obj = FormattersHelpers.ReadRowsetProperty(this.xmlReader, this.xmlReader.LocalName, this.xmlReader.LookupNamespace(this.xmlReader.Prefix), type, false, isArray, false); if (flag) { string strIn = obj as string; ColumnXmlReader columnXmlReader = new ColumnXmlReader(strIn); obj = columnXmlReader; } } else if (flag) { ColumnXmlReader columnXmlReader2 = new ColumnXmlReader(this.xmlReader, this.xmlReader.LocalName, this.xmlReader.NamespaceURI); obj = columnXmlReader2; } else { obj = FormattersHelpers.ReadRowsetProperty(this.xmlReader, this.xmlReader.LocalName, this.xmlReader.NamespaceURI, type, false, isArray, false); } } else if (this.sequentialAccess) { obj = xmlaDataReader; } else { bool flag2 = xmlaDataReader.IsClosed; if (flag2) { xmlaDataReader.ReOpen(); } int count = xmlaDataReader.dtStore.Rows.Count; xmlaDataReader.currentParentRow = this.dtStore.Rows.Count; while (xmlaDataReader.InternalRead()) { } obj = count; } return(obj); }
public object GetValue(int ordinal) { object obj = this.InternalGetValue(ordinal); bool flag = FormattersHelpers.GetColumnXsdTypeName(this.dtStore.Columns[ordinal]) == "xmlDocument"; if (flag) { ColumnXmlReader columnXmlReader = obj as ColumnXmlReader; if (columnXmlReader.IsDataSet) { obj = columnXmlReader.Dataset; } else { obj = columnXmlReader; } } return(obj); }