private CilType ProcessType(IKVM.Reflection.Type type)
{
var result = new CilType
{
Name = type.Name,
Namespace = type.Namespace,
BaseType = type.BaseType != null ? type.BaseType.FullName : null,
ReflectionType = type
};
var methods = new List <CilMethod>();
result.Methods = methods;
var flags = BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static;
foreach (var method in type.GetMethods(flags))
{
if (method.DeclaringType == type)
{
methods.Add(ProcessMethod(result, method));
}
}
foreach (var ctor in type.GetConstructors(flags))
{
if (ctor.DeclaringType == type)
{
methods.Add(ProcessMethod(result, ctor));
}
}
return(result);
}