Beispiel #1
0
        private IEnumerable <IModuleContainer> ReadModules()
        {
            Position = Marshal.SizeOf <DBIHeader>();

            ModuleListReader rdr = ctx.GetService <ModuleListReader>();

            if (rdr == null)
            {
                rdr = new ModuleListReader(ctx, this, Header.ModuleListSize);
                ctx.AddService <ModuleListReader>(rdr);
            }

            IEnumerable <ModuleInfo> moduleInfoList = rdr.Modules;

            foreach (ModuleInfo mod in moduleInfoList)
            {
                LazyModuleProvider provider = new LazyModuleProvider(ctx, mod);

                if (OnModuleReaderInit != null)
                {
                    provider.OnModuleReaderInit += OnModuleReaderInit;
                }
                if (OnModuleData != null)
                {
                    provider.OnModuleData += OnModuleData;
                }
                yield return(provider);
            }
        }
Beispiel #2
0
        private IEnumerable <IModuleContainer> ReadModules()
        {
            ctx.ModuleListReader = new ModuleListReader(Stream, hdr.ModuleListSize);

            IEnumerable <ModuleInfo> moduleInfoList = ctx.ModuleListReader.Modules;

            foreach (ModuleInfo mod in moduleInfoList)
            {
                LazyModuleProvider provider = new LazyModuleProvider(ctx, mod);

                if (OnModuleReaderInit != null)
                {
                    provider.OnModuleReaderInit += OnModuleReaderInit;
                }
                if (OnModuleData != null)
                {
                    provider.OnModuleData += OnModuleData;
                }
                yield return(provider);
            }
        }