File size: 1,662 Bytes
fab29d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using VersOne.Epub.Schema;

namespace VersOne.Epub
{
    /// <summary>
    /// The base class for a remote content file outside of the EPUB archive (e.g., an HTML file or an image).
    /// Unlike <see cref="EpubRemoteContentFileRef" />, the classes derived from this base class contain the whole content of the file.
    /// </summary>
    public abstract class EpubRemoteContentFile : EpubContentFile
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="EpubRemoteContentFile" /> class.
        /// </summary>
        /// <param name="key">The content file key as it is declared in the EPUB manifest (in the <see cref="EpubManifestItem.Href" /> property).</param>
        /// <param name="contentType">The type of the content of the file.</param>
        /// <param name="contentMimeType">The MIME type of the content of the file.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="contentMimeType" /> parameter is <c>null</c>.</exception>
        protected EpubRemoteContentFile(string key, EpubContentType contentType, string contentMimeType)
            : base(key, contentType, contentMimeType)
        {
        }

        /// <summary>
        /// Gets the absolute URI of the remote content file (as it is specified in the EPUB manifest).
        /// </summary>
        public string Url => Key;

        /// <summary>
        /// Gets the location of the content file which is always <see cref="EpubContentLocation.REMOTE" /> for remote content files.
        /// </summary>
        public override EpubContentLocation ContentLocation => EpubContentLocation.REMOTE;
    }
}