// Token: 0x0600106D RID: 4205 RVA: 0x00032464 File Offset: 0x00030664 public override string GetName(int ordinal) { ExTraceGlobals.VerboseTracer.Information <int>((long)this.GetHashCode(), "-->MonadDataReader.GetName({0})", ordinal); string text = null; if (this.HasSchema) { COPropertyInfo copropertyInfo = this.properties[ordinal]; if (copropertyInfo != null) { text = copropertyInfo.Name; } } ExTraceGlobals.VerboseTracer.Information <string>((long)this.GetHashCode(), "<--MonadDataReader.GetName(), {0}", text); return(text); }
// Token: 0x0600106C RID: 4204 RVA: 0x000323D0 File Offset: 0x000305D0 public override Type GetFieldType(int ordinal) { ExTraceGlobals.VerboseTracer.Information <int>((long)this.GetHashCode(), "-->MonadDataReader.GetFieldType({0})", ordinal); Type type = typeof(object); if (this.HasSchema) { COPropertyInfo copropertyInfo = this.properties[ordinal]; if (copropertyInfo != null) { type = copropertyInfo.Type; if (type.IsGenericType && type.GetGenericTypeDefinition().Equals(typeof(Nullable <>))) { type = Nullable.GetUnderlyingType(copropertyInfo.Type); } } } ExTraceGlobals.VerboseTracer.Information <Type>((long)this.GetHashCode(), "<--MonadDataReader.GetFieldType(), {0}", type); return(type); }
// Token: 0x0600106A RID: 4202 RVA: 0x000320D0 File Offset: 0x000302D0 public override object GetValue(int ordinal) { ExTraceGlobals.DataTracer.Information <int>((long)this.GetHashCode(), "-->MonadDataReader.GetValue({0})", ordinal); this.AssertReaderIsOpen(); object result; try { object obj = null; if (this.HasSchema && this.currentRecord != null) { if (this.useBaseObject) { if (ordinal == 0) { obj = this.currentRecord.BaseObject; } } else { COPropertyInfo copropertyInfo = this.properties[ordinal]; if (copropertyInfo != null) { if (string.Equals(copropertyInfo.Name, this.preservedObjectProperty)) { obj = this.currentRecord.BaseObject; } else { PSPropertyInfo pspropertyInfo = this.currentRecord.Properties[copropertyInfo.Name]; if (pspropertyInfo != null) { obj = pspropertyInfo.Value; if (obj is PSObject) { object obj2 = this.UnWrappPSObject(obj as PSObject); if (obj2 is ArrayList) { obj = obj2; } } if (copropertyInfo.Type == typeof(string) && obj is IList) { obj = this.FormatListToString((IList)obj); } else if (copropertyInfo.Type == typeof(string) && obj != null && obj.GetType().IsEnum) { obj = LocalizedDescriptionAttribute.FromEnum(obj.GetType(), obj); } else if (copropertyInfo.Type == typeof(EnumObject)) { obj = new EnumObject(obj as Enum); } else if (copropertyInfo.Type == typeof(string) && obj != null && obj.GetType() == typeof(bool)) { bool flag = (bool)obj; if (flag) { obj = Strings.TrueString; } else { obj = Strings.FalseString; } } else if (obj != null && obj.GetType() == typeof(string)) { if (copropertyInfo.Type.IsEnum) { obj = Enum.Parse(copropertyInfo.Type, obj as string); } else if (copropertyInfo.Type == typeof(Guid)) { obj = new Guid(obj as string); } } } } } } } ExTraceGlobals.DataTracer.Information((long)this.GetHashCode(), "<--MonadDataReader.GetValue(), {0}", new object[] { obj }); result = obj; } catch (GetValueException ex) { Exception innerException = ex.InnerException; while (innerException is TargetInvocationException) { innerException = innerException.InnerException; } if (innerException != null) { result = innerException.Message; } else { result = ex.Message; } } return(result); }