Пример #1
0
        /// <summary>
        ///     Loads the resource table from the cache file.
        /// </summary>
        /// <param name="reader">The stream to read from.</param>
        /// <returns>
        ///     The loaded resource table, or <c>null</c> if loading failed.
        /// </returns>
        public ResourceTable LoadResourceTable(IReader reader)
        {
            if (_layoutTable == null || _gestalt == null)
            {
                return(null);
            }

            var result = new ResourceTable();

            result.Pages.AddRange(_layoutTable.LoadPages(reader));
            IEnumerable <ResourcePointer> pointers = _layoutTable.LoadPointers(reader, result.Pages);

            result.Resources.AddRange(_gestalt.LoadResources(reader, _tags, pointers.ToList()));
            return(result);
        }
Пример #2
0
        /// <summary>
        ///     Loads the resource table from the cache file.
        /// </summary>
        /// <param name="reader">The stream to read from.</param>
        /// <returns>
        ///     The loaded resource table, or <c>null</c> if loading failed.
        /// </returns>
        public ResourceTable LoadResourceTable(IReader reader)
        {
            if (_layoutTable == null || _gestalt == null)
            {
                return(null);
            }

            var result = new ResourceTable();

            result.Pages.AddRange(_layoutTable.LoadPages(reader));
            result.Sizes.AddRange(_layoutTable.LoadSizes(reader));
            var pointers = _layoutTable.LoadPointers(reader, result.Pages, result.Sizes);

            result.Resources.AddRange(_gestalt.LoadResources(reader, _tags, pointers.ToList()));
            result.Predictions.AddRange(_gestalt.LoadPredictions(reader, _tags, result.Resources));
            return(result);
        }