Ejemplo n.º 1
0
        private bool b()
        {
            ComponentManager.ComponentInfo[] componentsByType = ComponentManager.Instance.GetComponentsByType(ComponentManager.ComponentTypeFlags.Archive, true);
            List <Assembly> list = new List <Assembly>();

            for (int i = 0; i < componentsByType.Length; i++)
            {
                ComponentManager.ComponentInfo            componentInfo = componentsByType[i];
                ComponentManager.ComponentInfo.PathInfo[] allEntryPointsForThisPlatform = componentInfo.GetAllEntryPointsForThisPlatform();
                for (int j = 0; j < allEntryPointsForThisPlatform.Length; j++)
                {
                    ComponentManager.ComponentInfo.PathInfo pathInfo = allEntryPointsForThisPlatform[j];
                    string   fileName = Path.Combine(VirtualFileSystem.ExecutableDirectoryPath, pathInfo.Path);
                    Assembly item     = AssemblyUtils.LoadAssemblyByFileName(fileName);
                    if (!list.Contains(item))
                    {
                        list.Add(item);
                    }
                }
            }
            List <Type> list2 = new List <Type>();

            foreach (Assembly current in list)
            {
                Type[] types = current.GetTypes();
                for (int k = 0; k < types.Length; k++)
                {
                    Type type = types[k];
                    if (typeof(ArchiveFactory).IsAssignableFrom(type) && !type.IsAbstract)
                    {
                        list2.Add(type);
                    }
                }
            }
            foreach (Type current2 in list2)
            {
                ConstructorInfo constructor    = current2.GetConstructor(new Type[0]);
                ArchiveFactory  archiveFactory = (ArchiveFactory)constructor.Invoke(null);
                if (!archiveFactory.OnInit())
                {
                    return(false);
                }
                this.S.Add(archiveFactory);
            }
            return(true);
        }
Ejemplo n.º 2
0
 protected Archive(ArchiveFactory factory, string fileName)
 {
     this.archiveFactory = factory;
     this.fileName       = fileName;
 }