//public DTypeInfo GetInterface (string iface) public DArgumentInfo[] GetFields(string iface) { DTypeInfo dti = new DTypeInfo(iface); Type declType = dti.ToType(); List <DArgumentInfo> fields = new List <DArgumentInfo>(); foreach (FieldInfo fi in declType.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)) { fields.Add(new DArgumentInfo(fi.Name, new DTypeInfo(fi.FieldType.FullName))); } //return dti; return(fields.ToArray()); }
public DynamicMethod GetDM() { List <Type> parms = new List <Type>(); parms.Add(typeof(object)); foreach (DTypeInfo dti in Parameters) { parms.Add(dti.ToType()); } DynamicMethod dm = new DynamicMethod(Name, ReturnType.ToType(), parms.ToArray(), typeof(DemoBase)); ILGenerator ilg = dm.GetILGenerator(); Implement(ilg); return(dm); }
//public DTypeInfo GetInterface (string iface) public DArgumentInfo[] GetFields (string iface) { DTypeInfo dti = new DTypeInfo (iface); Type declType = dti.ToType(); List<DArgumentInfo> fields = new List<DArgumentInfo>(); foreach (FieldInfo fi in declType.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)) fields.Add (new DArgumentInfo(fi.Name, new DTypeInfo(fi.FieldType.FullName))); //return dti; return fields.ToArray(); }