38 public Dictionary<string, TypeInfo>
Types =
new Dictionary<string, TypeInfo>();
39 public Dictionary<string, TypeInfo>
Objects =
new Dictionary<string, TypeInfo>();
40 public Dictionary<string, Module>
Modules =
new Dictionary<string, Module>();
41 public Dictionary<string, ConstructorInfo>
Constructors =
new Dictionary<string, ConstructorInfo>();
42 public Dictionary<string, InterfaceMapping>
Interfaces =
new Dictionary<string, InterfaceMapping>();
58 public Dictionary<string, Enum>
Enums =
new Dictionary<string, Enum>();
59 public Dictionary<string, Type>
Interfaces =
new Dictionary<string, Type>();
60 public Dictionary<string, ConstructorInfo>
Constructors =
new Dictionary<string, ConstructorInfo>();
61 public Dictionary<string, List<MemberInfo>>
Members =
new Dictionary<string, List<MemberInfo>>();
62 public Dictionary<string, FieldInfo>
Fields =
new Dictionary<string, FieldInfo>();
63 public Dictionary<string, PropertyInfo>
Properties =
new Dictionary<string, PropertyInfo>();
64 public Dictionary<string, List<MethodInfo>>
Methods =
new Dictionary<string, List<MethodInfo>>();
73 if (
Members.ContainsKey(inf.ToString()))
75 Members[inf.ToString()].Add(inf);
79 List<MemberInfo> l =
new List<MemberInfo>();
90 if (
Methods.ContainsKey(inf.ToString()))
92 Methods[inf.ToString()].Add(inf);
96 List<MethodInfo> l =
new List<MethodInfo>();
106 Fields.Add(inf.ToString(), inf);
124 public object Invoke(
string name,
object o,
object[] args)
126 return type.InvokeMember(name, BindingFlags.InvokeMethod,
null, o, args);
136 PropertyInfo p =
type.GetProperty(name);
137 return p.GetValue(obj);
144 return Activator.CreateInstance(
type);
157 dll = Assembly.LoadFile(file);
158 Type[] tps =
dll.GetExportedTypes();
159 foreach (Type type
in tps)
163 string s = type.ToString();
164 s = s.Remove(0, s.LastIndexOf(
'.') + 1);
177 Module[] mds =
dll.GetModules();
178 foreach (Module m
in mds)
180 string s = m.ToString();
181 s = s.Remove(0, s.LastIndexOf(
'.') + 1);
195 public object Invoke(Type type,
string name,
object o,
object[] args)
197 return type.InvokeMember(name, BindingFlags.InvokeMethod,
null, o, args);
209 public object Invoke(
string st,
string name,
object o,
object[] args)
211 Type t =
Types[st].type;
212 return t.InvokeMember(name, BindingFlags.InvokeMethod,
null, o, args);
223 Type myType =
Types[type].type;
224 PropertyInfo p = myType.GetProperty(name);
225 return p.GetValue(obj);
231 private void GetEnums(TypeInfo type)
233 Array ar = Enum.GetValues(type.type);
234 foreach (var item
in ar)
236 if (!type.Enums.ContainsKey(item.ToString()))
237 type.Enums.Add(item.ToString(), (Enum)item);
245 private void GetInterfaces(TypeInfo type)
247 Type[] ts = type.type.GetInterfaces();
248 foreach (Type item
in ts)
250 type.Interfaces.Add(item.ToString(), item);
256 private void GetConstructors(TypeInfo type)
258 ConstructorInfo[] ts = type.type.GetConstructors();
259 foreach (ConstructorInfo item
in ts)
261 type.Constructors.Add(item.ToString(), item);
267 private void GetMembers(TypeInfo type)
269 MemberInfo[] ts = type.type.GetMembers();
270 foreach (MemberInfo item
in ts)
272 type.AddMember(item);
278 private void GetProperties(TypeInfo type)
280 PropertyInfo[] ts = type.type.GetProperties();
281 foreach (PropertyInfo item
in ts)
283 type.AddProperty(item);
289 private void GetFields(TypeInfo type)
291 FieldInfo[] ts = type.type.GetFields();
292 foreach (FieldInfo item
in ts)
300 private void GetMethods(TypeInfo type)
302 MethodInfo[] ts = type.type.GetMethods();
303 foreach (MethodInfo item
in ts)
305 type.AddMethod(item);