internal AppDomainInitializerInfo(AppDomainInitializer init)
{
Info=null;
if (init==null)
return;
ArrayList itemInfo=new ArrayList();
ArrayList nestedDelegates=new ArrayList();
nestedDelegates.Add(init);
int idx=0;
while (nestedDelegates.Count>idx)
{
AppDomainInitializer curr=(AppDomainInitializer)nestedDelegates[idx++];
Delegate[] list= curr.GetInvocationList();
for (int i=0;i<list.Length;i++)
{
if (!list[i].Method.IsStatic)
{
if(list[i].Target==null)
continue;
AppDomainInitializer nested = list[i].Target as AppDomainInitializer;
if (nested!=null)
nestedDelegates.Add(nested);
else
throw new ArgumentException(Environment.GetResourceString("Arg_MustBeStatic"),
list[i].Method.ReflectedType.FullName+"::"+list[i].Method.Name);
}
else
{
ItemInfo info=new ItemInfo();
info.TargetTypeAssembly=list[i].Method.ReflectedType.Module.Assembly.FullName;
info.TargetTypeName=list[i].Method.ReflectedType.FullName;
info.MethodName=list[i].Method.Name;
itemInfo.Add(info);
}
}
}
Info=(ItemInfo[])itemInfo.ToArray(typeof(ItemInfo));
}