public static Hashtable InspectClass(Type type) { Hashtable hashtable = (Hashtable) ClassInspector.ReflectionCache[(object) type]; if (hashtable != null) return hashtable; Hashtable h = new Hashtable(); ClassInspector.InspectClassInternal(type, h); ClassInspector.ReflectionCache[(object) type] = (object) h; return h; }
private static void InspectClassInternal(Type type, Hashtable h) { FieldInfo[] fields = type.GetFields(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); int length = fields.Length; for (int index = 0; index < length; ++index) { if ((fields[index].Attributes & FieldAttributes.NotSerialized) != FieldAttributes.NotSerialized) h[(object) fields[index].Name] = (object) fields[index]; } Type baseType = type.BaseType; if ((object) baseType == null || baseType.Equals(typeof (object))) return; ClassInspector.InspectClassInternal(baseType, h); }