Пример #1
0
 public EPubInternalPath(EPubInternalPath folderPath, string zipPath)
 {
     string folder = folderPath.GetPathWithoutFileNameAsString();
     string path = folder + zipPath;
     string[] pathArray = path.Split('/');
     LoadAsPath(pathArray);
 }
Пример #2
0
        public EPubInternalPath(EPubInternalPath folderPath, string zipPath)
        {
            string folder = folderPath.GetPathWithoutFileNameAsString();
            string path   = folder + zipPath;

            string[] pathArray = path.Split('/');
            LoadAsPath(pathArray);
        }
Пример #3
0
        public object Clone()
        {
            EPubInternalPath newPath = (EPubInternalPath)MemberwiseClone();

            newPath._path.Clear();
            foreach (var pathElement in _path)
            {
                var element = (PathElement)pathElement;
                newPath._path.Add((PathElement)element.Clone());
            }
            return(newPath);
        }
Пример #4
0
        /// <summary>
        /// Return Path only part of the path
        /// </summary>
        /// <returns></returns>
        public IEPubInternalPath GetPathWithoutFileName()
        {
            EPubInternalPath newPathObject = (EPubInternalPath)MemberwiseClone();

            newPathObject._path.Clear();
            foreach (var pathElement in _path) // copy all without Filename
            {
                var element = (PathElement)pathElement;
                if (element.Type != PathType.File)
                {
                    newPathObject._path.Add((PathElement)element.Clone());
                }
            }
            return(newPathObject);
        }
Пример #5
0
 public string GetRelativePath(string path, bool flatStructure)
 {
     EPubInternalPath newPath = new EPubInternalPath(path);
     return GetRelativePath(newPath, flatStructure);
 }
Пример #6
0
 public static string FormatImagePath(string validName, bool flatStructure)
 {
     EPubInternalPath imagePath = new EPubInternalPath(EPubInternalPath.GetDefaultLocation(DefaultLocations.DefaultImagesFolder), validName);
     return imagePath.GetRelativePath(EPubInternalPath.GetDefaultLocation(DefaultLocations.DefaultTextFolder), flatStructure);
 }
Пример #7
0
        public string GetRelativePath(string path, bool flatStructure)
        {
            EPubInternalPath newPath = new EPubInternalPath(path);

            return(GetRelativePath(newPath, flatStructure));
        }