public void CheckAssemblySCValidity(Assembly asm)
{
Type[] types = null;
bool flag = true;
ArrayList list = null;
RegistrationServices services = new RegistrationServices();
try
{
types = asm.GetTypes();
}
catch (ReflectionTypeLoadException exception)
{
types = exception.Types;
}
foreach (Type type in types)
{
if (((null != type) && type.IsClass) && type.IsSubclassOf(typeof(ServicedComponent)))
{
if (!services.TypeRequiresRegistration(type) && !type.IsAbstract)
{
flag = false;
if (list == null)
{
list = new ArrayList();
}
RegistrationErrorInfo info = new RegistrationErrorInfo(null, null, type.ToString(), -2147467259);
list.Add(info);
}
ClassInterfaceType classInterfaceType = ServicedComponentInfo.GetClassInterfaceType(type);
foreach (MethodInfo info2 in type.GetMethods())
{
if (ReflectionCache.ConvertToInterfaceMI(info2) == null)
{
if (ServicedComponentInfo.HasSpecialMethodAttributes(info2))
{
this.ReportWarning(Resource.FormatString("Reg_NoClassInterfaceSecure", type.FullName, info2.Name));
}
if ((classInterfaceType == ClassInterfaceType.AutoDispatch) && ServicedComponentInfo.IsMethodAutoDone(info2))
{
this.ReportWarning(Resource.FormatString("Reg_NoClassInterface", type.FullName, info2.Name));
}
}
}
}
}
if (!flag)
{
RegistrationErrorInfo[] errorInfo = (RegistrationErrorInfo[]) list.ToArray(typeof(RegistrationErrorInfo));
throw new RegistrationException(Resource.FormatString("Reg_InvalidServicedComponents"), errorInfo);
}
}