This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
TargetMember.cs
165 lines (140 loc) · 4.04 KB
/
TargetMember.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
using System;
namespace Mono.Debugger.Languages
{
public enum TargetMemberAccessibility
{
Public,
Protected,
Internal,
Private
}
[Serializable]
public abstract class TargetMemberInfo : DebuggerMarshalByRefObject
{
public readonly TargetType Type;
public readonly string Name;
public readonly int Index;
public readonly bool IsStatic;
public readonly TargetMemberAccessibility Accessibility;
protected TargetMemberInfo (TargetType type, string name, int index, bool is_static,
TargetMemberAccessibility accessibility)
{
this.Type = type;
this.Name = name;
this.Index = index;
this.IsStatic = is_static;
this.Accessibility = accessibility;
}
protected abstract string MyToString ();
public override string ToString ()
{
return String.Format ("{0} ({1}:{2}:{3}:{4})",
GetType (), Type, Index, IsStatic, MyToString ());
}
}
[Serializable]
public abstract class TargetEnumInfo : TargetMemberInfo
{
public readonly bool HasConstValue;
protected TargetEnumInfo (TargetType type, string name, int index, bool is_static,
TargetMemberAccessibility accessibility, int position,
int offset, bool has_const_value)
: base (type, name, index, is_static, accessibility)
{
this.HasConstValue = has_const_value;
}
public abstract object ConstValue {
get;
}
protected override string MyToString ()
{
return String.Format ("{0}:{1}", Type, HasConstValue);
}
}
[Serializable]
public abstract class TargetFieldInfo : TargetMemberInfo
{
public readonly int Offset;
public readonly int Position;
public readonly bool HasConstValue;
protected TargetFieldInfo (TargetType type, string name, int index, bool is_static,
TargetMemberAccessibility accessibility, int position,
int offset, bool has_const_value)
: base (type, name, index, is_static, accessibility)
{
this.Position = position;
this.Offset = offset;
this.HasConstValue = has_const_value;
}
public abstract object ConstValue {
get;
}
protected override string MyToString ()
{
return String.Format ("{0}:{1}:{2}", Type, Offset, HasConstValue);
}
}
[Serializable]
public abstract class TargetPropertyInfo : TargetMemberInfo
{
public readonly TargetFunctionType Getter;
public readonly TargetFunctionType Setter;
protected TargetPropertyInfo (TargetType type, string name, int index,
bool is_static, TargetMemberAccessibility accessibility,
TargetFunctionType getter, TargetFunctionType setter)
: base (type, name, index, is_static, accessibility)
{
this.Getter = getter;
this.Setter = setter;
}
public bool CanRead {
get { return Getter != null; }
}
public bool CanWrite {
get { return Setter != null; }
}
protected override string MyToString ()
{
return String.Format ("{0}:{1}", Getter, Setter);
}
}
[Serializable]
public abstract class TargetEventInfo : TargetMemberInfo
{
public readonly TargetFunctionType Add;
public readonly TargetFunctionType Remove;
public readonly TargetFunctionType Raise;
protected TargetEventInfo (TargetType type, string name, int index,
bool is_static, TargetMemberAccessibility accessibility,
TargetFunctionType add, TargetFunctionType remove,
TargetFunctionType raise)
: base (type, name, index, is_static, accessibility)
{
this.Add = add;
this.Remove = remove;
this.Raise = raise;
}
protected override string MyToString ()
{
return String.Format ("{0}:{1}:{2}", Add, Remove, Raise);
}
}
[Serializable]
public abstract class TargetMethodInfo : TargetMemberInfo
{
public readonly string FullName;
public new readonly TargetFunctionType Type;
protected TargetMethodInfo (TargetFunctionType type, string name, int index,
bool is_static, TargetMemberAccessibility accessibility,
string full_name)
: base (type, name, index, is_static, accessibility)
{
this.Type = type;
this.FullName = full_name;
}
protected override string MyToString ()
{
return String.Format ("{0}", FullName);
}
}
}