15
16
EvaluationContext ctx;
16
17
BindingFlags bindingFlags;
18
IObjectSource objectSource;
18
public FilteredMembersSource (EvaluationContext ctx, object type, object obj, BindingFlags bindingFlags)
20
public FilteredMembersSource (EvaluationContext ctx, IObjectSource objectSource, object type, object obj, BindingFlags bindingFlags)
23
25
this.bindingFlags = bindingFlags;
26
this.objectSource = objectSource;
26
public static ObjectValue CreateNode (EvaluationContext ctx, object type, object obj, BindingFlags bindingFlags)
28
FilteredMembersSource src = new FilteredMembersSource (ctx, type, obj, bindingFlags);
29
public static ObjectValue CreateNonPublicsNode (EvaluationContext ctx, IObjectSource objectSource, object type, object obj, BindingFlags bindingFlags)
31
return CreateNode (ctx, objectSource, type, obj, bindingFlags, "Non-public members");
34
public static ObjectValue CreateStaticsNode (EvaluationContext ctx, IObjectSource objectSource, object type, object obj, BindingFlags bindingFlags)
36
return CreateNode (ctx, objectSource, type, obj, bindingFlags, "Static members");
39
static ObjectValue CreateNode (EvaluationContext ctx, IObjectSource objectSource, object type, object obj, BindingFlags bindingFlags, string label)
41
FilteredMembersSource src = new FilteredMembersSource (ctx, objectSource, type, obj, bindingFlags);
31
if ((bindingFlags & BindingFlags.NonPublic) != 0)
32
label = "Non-public members";
34
label = "Static members";
35
return ObjectValue.CreateObject (src, new ObjectPath (label), "", "", ObjectValueFlags.ReadOnly, null);
43
return ObjectValue.CreateObject (src, new ObjectPath (label), "", "", ObjectValueFlags.Group|ObjectValueFlags.ReadOnly|ObjectValueFlags.NoRefresh, null);
38
46
public ObjectValue[] GetChildren (ObjectPath path, int index, int count)
48
var names = new ObjectValueNameTracker (ctx);
49
object tdataType = null;
50
TypeDisplayData tdata = null;
40
51
List<ObjectValue> list = new List<ObjectValue> ();
41
foreach (ValueReference val in ctx.Adapter.GetMembersSorted (ctx, type, obj, bindingFlags)) {
42
list.Add (val.CreateObjectValue ());
52
foreach (ValueReference val in ctx.Adapter.GetMembersSorted (ctx, objectSource, type, obj, bindingFlags)) {
53
object decType = val.DeclaringType;
54
if (decType != null && decType != tdataType) {
56
tdata = ctx.Adapter.GetTypeDisplayData (ctx, decType);
58
DebuggerBrowsableState state = tdata.GetMemberBrowsableState (val.Name);
59
if (state == DebuggerBrowsableState.Never)
61
ObjectValue oval = val.CreateObjectValue ();
62
names.FixName (val, oval);
44
65
if ((bindingFlags & BindingFlags.NonPublic) == 0) {
45
66
BindingFlags newFlags = bindingFlags | BindingFlags.NonPublic;
46
67
newFlags &= ~BindingFlags.Public;
47
list.Add (CreateNode (ctx, type, obj, newFlags));
68
list.Add (CreateNonPublicsNode (ctx, objectSource, type, obj, newFlags));
49
70
return list.ToArray ();
73
public ObjectValue GetValue (ObjectPath path, EvaluationOptions options)
75
throw new NotSupportedException ();
52
78
public string SetValue (ObjectPath path, string value)