public Application(FileInfo source, Dictionary <string, Service> services, ContainerEngine containerEngine) { Source = source.FullName; ContextDirectory = source.DirectoryName !; Services = services; ContainerEngine = containerEngine; }
public Application(string name, FileInfo source, int?dashboardPort, Dictionary <string, Service> services, ContainerEngine containerEngine) { Name = name; Source = source.FullName; ContextDirectory = source.DirectoryName !; Services = services; ContainerEngine = containerEngine; DashboardPort = dashboardPort; }
private Structure ReadStructure() { var container = ReadFileFromArchive(this._archive, Const.CONTAINER_PATH, p => ContainerEngine.Read(p)); if (container == null) { throw new InvalidDataException("container file not found."); } Structure result = new Structure { Container = container, Package = ReadFileFromArchive(this._archive, container.FullPath, p => OpfEngine.Read(p)) ?? throw new InvalidDataException("opf file not found."), }; var opfDirectory = Path.GetDirectoryName(container.FullPath); if (result.Package.Version >= 3f) { string relativePath = FindNavFilePath(result.Package); var filePath = PathHelper.Combine(opfDirectory, relativePath); result.Nav = ReadFileFromArchive(this._archive, filePath, p => NavEngine.Read(p)) ?? throw new InvalidDataException("navigation file not found."); } else { var relativePath = FindNcxFilePath(result.Package); var filePath = PathHelper.Combine(opfDirectory, relativePath); result.Ncx = ReadFileFromArchive(this._archive, filePath, p => NcxEngine.Read(p)) ?? throw new InvalidDataException("ncx file not found."); } return(result); }