private void CollectActions(Type controllerType, ControllerMetaDescriptor desc)
{
// HACK: GetRealControllerType is a workaround for DYNPROXY-14 bug
// see: http://support.castleproject.org/browse/DYNPROXY-14
controllerType = GetRealControllerType(controllerType);
MethodInfo[] methods = controllerType.GetMethods(BindingFlags.Public | BindingFlags.Instance);
foreach(MethodInfo method in methods)
{
Type declaringType = method.DeclaringType;
if (declaringType == typeof(Object) ||
declaringType == typeof(Controller) ||
declaringType == typeof(SmartDispatcherController))
{
continue;
}
if (desc.Actions.Contains(method.Name))
{
ArrayList list = desc.Actions[method.Name] as ArrayList;
if (list == null)
{
list = new ArrayList();
list.Add(desc.Actions[method.Name]);
desc.Actions[method.Name] = list;
}
list.Add(method);
}
else
{
desc.Actions[method.Name] = method;
}
}
}