static void Main(string[] args)
        {
            byte[]       data;
            EbookSplited desSerializado;
            EbookSplited ebook;

            FileInfo      file;
            DirectoryInfo dir = new DirectoryInfo(Environment.CurrentDirectory);

            Ebook.Directory = new DirectoryInfo(System.IO.Path.Combine(dir.Parent.Parent.Parent.Parent.FullName, @"BooksSplitedGUI\bin\Debug\netcoreapp3.1\Ebooks")).FullName;
            file            = new DirectoryInfo(Ebook.Directory).GetDirectories()[0].GetFiles()[5];



            ebook = new EbookSplited(System.IO.Path.GetRelativePath(EbookSplited.Directory, file.FullName));


            //omito estos capitulos
            ebook.SetCapitulosAOmitir(0, 1, 2, 3, 4, 5, 6, 24, 25, 26, 27);

            //pruebo serialización
            data           = ebook.GetBytes();
            desSerializado = EbookSplited.GetEbookSplited(data);

            for (int i = 0; i < desSerializado.TotalChapters; i++)
            {
                Console.WriteLine("{2} - Page {0}/{1}", i, desSerializado.TotalChapters, file.Name);
                Console.WriteLine(string.Join('\n', desSerializado.GetContentElements(i)));
                Console.ReadLine();
                Console.Clear();
            }
        }
        void ISaveAndLoad.Load()
        {
            string path = System.IO.Path.Combine(EbookSplited.Directory, VersionPath);

            if (File.Exists(path))
            {
                Version = EbookSplited.GetEbookSplited(System.IO.File.ReadAllBytes(path));
            }
            if (!Equals(ReferencePath, default))
            {
                path = System.IO.Path.Combine(EbookStandaritzed.Directory, ReferencePath);
                if (File.Exists(path))
                {
                    Reference = EbookStandaritzed.GetEbookStandaritzed(System.IO.File.ReadAllBytes(path));
                }
                else
                {
                    Reference = new EbookStandaritzed()
                    {
                        Version = this.Version
                    }
                };
            }
            else
            {
                Reference = new EbookStandaritzed()
                {
                    Version = this.Version
                };
            }
        }
        public IEnumerable <string> GetParrafos(EbookSplited version, int chapter, string joiner = "")
        {
            IEnumerable <string> parrafosVer = version.GetContentElementsArray(chapter);

            if (ParrafosEditados.Count > 0)
            {
                return(Spliter.GetParts(ParrafosEditados, parrafosVer, joiner));
            }
            else
            {
                return(parrafosVer);
            }
        }
 public EbookStandaritzed(EbookSplited ebookSplitedVersion, EbookSplited ebookSplitedReference = default)
 {
     if (Equals(ebookSplitedVersion, default))
     {
         throw new NullReferenceException("se requiere un ebook splited!");
     }
     if (Equals(ebookSplitedReference, default))
     {
         ebookSplitedReference = ebookSplitedVersion;
     }
     Version   = ebookSplitedVersion;
     Reference = new EbookStandaritzed()
     {
         Version = ebookSplitedReference
     };
     CapitulosEditados = new Capitulo[Version.TotalChapters];
 }
 public bool Finished(EbookStandaritzed original, EbookSplited version, int chapter)
 {
     return(GetParrafos(version, chapter).ToArray().Length == original.Version.GetContentElementsArray(chapter).Length);
 }