public static TagContainer ReadTagContainer(IReader reader)
        {
            var tags = new TagContainer();

            var containerFile = new ContainerReader(reader);

            if (!containerFile.NextBlock() || containerFile.BlockName != "tagc")
            {
                throw new ArgumentException("Not a valid tag container file");
            }

            containerFile.EnterBlock();
            ReadBlocks(reader, containerFile, tags);
            containerFile.LeaveBlock();

            return(tags);
        }
示例#2
0
        public static Patch LoadPatch(IReader reader)
        {
            var container = new ContainerReader(reader);

            if (!container.NextBlock() || container.BlockName != "asmp")
            {
                throw new InvalidOperationException("Invalid assembly patch");
            }
            if (container.BlockVersion > 0)
            {
                throw new InvalidOperationException("Unrecognized patch version");
            }

            container.EnterBlock();
            Patch patch = ReadBlocks(reader, container);

            container.LeaveBlock();

            return(patch);
        }