protected void ResolveClass(Thread target) { if (class_info != null) return; class_info = Type.ForceClassInitialization (target); if (class_info == null) throw new ScriptingException ("Class `{0}' not initialized yet.", Type.Name); }
protected void FormatClassObject(Thread target, TargetClassObject obj, TargetClass class_info, ref bool first) { Append ("{ "); indent_level += 3; if (obj.Type.HasParent) { TargetClassObject parent = obj.GetParentObject (target); if ((parent != null) && (parent.Type != parent.Type.Language.ObjectType)) { Append ("<{0}> = ", parent.Type.Name); CheckLineWrap (); FormatStructObject (target, parent); first = false; } } TargetFieldInfo[] fields = class_info.GetFields (target); for (int i = 0; i < fields.Length; i++) { if (fields [i].IsStatic || fields [i].HasConstValue) continue; if (fields [i].IsCompilerGenerated) continue; if (fields [i].DebuggerBrowsableState == DebuggerBrowsableState.Never) continue; if (!first) { Append (", "); CheckLineWrap (); } first = false; Append (fields [i].Name + " = "); try { TargetObject fobj = class_info.GetField (target, obj, fields [i]); if (fobj == null) Append ("null"); else FormatObjectRecursed (target, fobj, true); } catch { Append ("<cannot display object>"); } } Append (first ? "}" : " }"); indent_level -= 3; }