protected static ReflectedMember CreateMemberDefinition(MemberInfo info) { MethodInfo method; FieldInfo field; PropertyInfo property; ConstructorInfo constructor; ReflectedMember md; if ((method = info as MethodInfo) != null) { md = new ReflectedMethod(method); } else if ((field = info as FieldInfo) != null) { md = new ReflectedField(field); } else if ((property = info as PropertyInfo) != null) { md = new ReflectedProperty(property); } else if ((constructor = info as ConstructorInfo) != null) { md = new ReflectedConstructor(constructor); } else { md = null; } return(md); }
public override IList <FunctionInfo> InferMethods(SymbolId name) { Initialize(); List <ReflectedMember> list; IList <FunctionInfo> result = null; if (members.TryGetValue(name, out list)) { foreach (ReflectedMember member in list) { ReflectedMethod method = member as ReflectedMethod; if (null != method) { result = Engine.Union <FunctionInfo>(result, method.InferMethods(name)); } } } else if (type.Name == name.GetString()) { members.TryGetValue(SymbolTable.StringToId(".ctor"), out list); foreach (ReflectedMember member in list) { ReflectedConstructor constructor = member as ReflectedConstructor; if (constructor != null) { result = Engine.Union <FunctionInfo>(result, constructor.InferMethods(name)); } } } return(result); }
protected static ReflectedMember CreateMemberDefinition(MemberInfo info) { MethodInfo method; FieldInfo field; PropertyInfo property; ConstructorInfo constructor; ReflectedMember md; if ((method = info as MethodInfo) != null) { md = new ReflectedMethod(method); } else if ((field = info as FieldInfo) != null) { md = new ReflectedField(field); } else if ((property = info as PropertyInfo) != null) { md = new ReflectedProperty(property); } else if ((constructor = info as ConstructorInfo) != null) { md = new ReflectedConstructor(constructor); } else { md = null; } return md; }