private ReflectedMethodInfo CreateMethodInfo(MethodInfo methInfo) { var reflectedMethod = new ReflectedMethodInfo(methInfo.Name); reflectedMethod.SetPrivate(!methInfo.IsExport); reflectedMethod.IsFunction = methInfo.IsFunction; for (int i = 0; i < methInfo.Params.Length; i++) { var currentParam = methInfo.Params[i]; var reflectedParam = new ReflectedParamInfo(currentParam.Name, currentParam.IsByValue); reflectedParam.SetOwner(reflectedMethod); reflectedParam.SetPosition(i); reflectedMethod.Parameters.Add(reflectedParam); } return(reflectedMethod); }
private ReflectedMethodInfo CreateMethodInfo(MethodInfo methInfo) { var reflectedMethod = new ReflectedMethodInfo(methInfo.Name); reflectedMethod.SetPrivate(!methInfo.IsExport); reflectedMethod.IsFunction = methInfo.IsFunction; var unknownVal = ValueFactory.CreateInvalidValueMarker(); for (int i = 0; i < methInfo.Params.Length; i++) { var currentParam = methInfo.Params[i]; var reflectedParam = new ReflectedParamInfo(currentParam.Name, currentParam.IsByValue); reflectedParam.SetOwner(reflectedMethod); reflectedParam.SetPosition(i); if (currentParam.HasDefaultValue) { } reflectedParam.SetDefaultValue(unknownVal); if (currentParam.Annotations != null) { foreach (var annotation in currentParam.Annotations) { reflectedParam.AddAnnotation(annotation); } } reflectedMethod.Parameters.Add(reflectedParam); } if (methInfo.Annotations != null) { foreach (var annotation in methInfo.Annotations) { reflectedMethod.AddAnnotation(annotation); } } return(reflectedMethod); }