Ejemplo n.º 1
0
 internal AppDomainInfoEnum(AppDomainInfo[] appDomainInfos)
 {
     _appDomainInfos = appDomainInfos;
     _curPos = -1;
 }
 internal AppDomainInfo[] GetAppDomainInfos()
 {
     ArrayList list = new ArrayList();
     foreach (LockableAppDomainContext context in this.CloneAppDomainsCollection().Values)
     {
         lock (context)
         {
             HostingEnvironment hostEnv = context.HostEnv;
             if (hostEnv != null)
             {
                 IApplicationHost internalApplicationHost = hostEnv.InternalApplicationHost;
                 ApplicationInfo applicationInfo = hostEnv.GetApplicationInfo();
                 int siteId = 0;
                 if (internalApplicationHost != null)
                 {
                     try
                     {
                         siteId = int.Parse(internalApplicationHost.GetSiteID(), CultureInfo.InvariantCulture);
                     }
                     catch
                     {
                     }
                 }
                 AppDomainInfo info2 = new AppDomainInfo(applicationInfo.ID, applicationInfo.VirtualPath, applicationInfo.PhysicalPath, siteId, hostEnv.GetIdleValue());
                 list.Add(info2);
             }
         }
     }
     return (AppDomainInfo[]) list.ToArray(typeof(AppDomainInfo));
 }