/// <summary>
        /// Instantiates a new meta_path importer using an embedded ZIP resource file.
        /// </summary>
        /// <param name="fromAssembly"></param>
        /// <param name="resourceName"></param>
        public ResourceMetaPathImporter(Assembly fromAssembly, string resourceName) {
            _loader = new PackedResourceLoader(fromAssembly, resourceName);

            if (_loader.LoadZipDirectory(out _unpackedLibrary, out _unpackedModules,
                                         out _unpackingError))
                return;

            _unpackedLibrary = new Dictionary<string, PackedResourceInfo>();
            _unpackedModules = new Dictionary<string, PackedResourceInfo[]>();
            if (!String.IsNullOrEmpty(_unpackingError))
                throw MakeError("meta_path importer initialization error: {0}", _unpackingError);
        }
Пример #2
0
        /// <summary>
        /// Instantiates a new meta_path importer using an embedded ZIP resource file.
        /// </summary>
        /// <param name="fromAssembly"></param>
        /// <param name="resourceName"></param>
        public ResourceMetaPathImporter(Assembly fromAssembly, string resourceName)
        {
            _loader = new PackedResourceLoader(fromAssembly, resourceName);

            if (_loader.LoadZipDirectory(out _unpackedLibrary, out _unpackedModules,
                                         out _unpackingError))
            {
                return;
            }

            _unpackedLibrary = new Dictionary <string, PackedResourceInfo>();
            _unpackedModules = new Dictionary <string, PackedResourceInfo[]>();
            if (!String.IsNullOrEmpty(_unpackingError))
            {
                throw MakeError("meta_path importer initialization error: {0}", _unpackingError);
            }
        }