コード例 #1
0
        public static EpubSchema ReadSchema(ZipArchive epubArchive)
        {
            EpubSchema result               = new EpubSchema();
            string     rootFilePath         = RootFilePathReader.GetRootFilePath(epubArchive);
            string     contentDirectoryPath = ZipPathUtils.GetDirectoryPath(rootFilePath);

            result.ContentDirectoryPath = contentDirectoryPath;
            EpubPackage package = PackageReader.ReadPackage(epubArchive, rootFilePath);

            result.Package = package;
            EpubNavigation navigation = NavigationReader.ReadNavigation(epubArchive, contentDirectoryPath, package);

            result.Navigation = navigation;
            return(result);
        }
コード例 #2
0
ファイル: SchemaReader.cs プロジェクト: sk8tz/EpubReader
        public static async Task <EpubSchema> ReadSchemaAsync(ZipArchive epubArchive)
        {
            EpubSchema result       = new EpubSchema();
            string     rootFilePath = await RootFilePathReader.GetRootFilePathAsync(epubArchive).ConfigureAwait(false);

            string contentDirectoryPath = ZipPathUtils.GetDirectoryPath(rootFilePath);

            result.ContentDirectoryPath = contentDirectoryPath;
            EpubPackage package = await PackageReader.ReadPackageAsync(epubArchive, rootFilePath).ConfigureAwait(false);

            result.Package = package;
            EpubNavigation navigation = await NavigationReader.ReadNavigationAsync(epubArchive, contentDirectoryPath, package).ConfigureAwait(false);

            result.Navigation = navigation;
            return(result);
        }
コード例 #3
0
        public static async Task <EpubSchema> ReadSchemaAsync(ZipArchive epubArchive)
        {
            EpubSchema result = new EpubSchema();

            // Reading META-INF/container.xml
            string rootFilePath = await RootFilePathReader.GetRootFilePathAsync(epubArchive);

            // Getting directory path - usually it's: META-INF/
            string contentDirectoryPath = ZipPathUtils.GetDirectoryPath(rootFilePath);

            result.ContentDirectoryPath = contentDirectoryPath;
            //Reading the file content.opf
            EpubPackage package = await PackageReader.ReadPackageAsync(epubArchive, rootFilePath);

            result.Package = package;
            EpubNavigation navigation = await NavigationReader.ReadNavigationAsync(epubArchive, contentDirectoryPath, package);

            result.Navigation = navigation;
            return(result);
        }