Beispiel #1
0
        public SectionContribsReader(IServiceContainer ctx, uint sectionContribsSize, SpanStream stream) : base(stream)
        {
            this.SectionContribsSize = sectionContribsSize;

            UInt32 version = ReadUInt32();

            switch (version)
            {
            case (uint)SCVersion.V60:
                Version         = SCVersion.V60;
                SectionContribs = new CachedEnumerable <SectionContrib40>(ReadSectionContribsV1(ctx));
                break;

            case (uint)SCVersion.New:
                Version         = SCVersion.New;
                SectionContribs = new CachedEnumerable <SectionContrib40>(ReadSectionContribsV2(ctx));
                break;

            default:
                Version         = SCVersion.Old;
                SectionContribs = new CachedEnumerable <SectionContrib40>(ReadSectionContribsOld(ctx));
                break;
            }

            // VC++ 4.0 has no version code
            StreamOffset = (Version == SCVersion.Old) ? 0 : Position;
        }
        public SectionContribsReader(uint sectionContribsSize, SpanStream stream) : base(stream)
        {
            this.SectionContribsSize = sectionContribsSize;

            Version = ReadEnum <SCVersion>();
            switch (Version)
            {
            case SCVersion.V60:
                sectionContribsLazy = LazyFactory.CreateLazy(ReadSectionContribsV1);
                break;

            case SCVersion.New:
                sectionContribsLazy = LazyFactory.CreateLazy(ReadSectionContribsV2);
                break;

            default:
                sectionContribsLazy = LazyFactory.CreateLazy(ReadSectionContribsOld);
                break;
            }

            // after version
            StreamOffset = Position;
        }