nl.siegmann.epublib.domain.Resources.getAll C# (CSharp) Method

getAll() public method

public getAll ( ) : IEnumerable
return IEnumerable
        public IEnumerable<Resource> getAll()
        {
            return resources.Values;
        }

Usage Example

 /// <summary>
 /// Strips off the package prefixes up to the href of the packageHref.  Example: If
 /// the packageHref is "OEBPS/content.opf" then a resource href like "OEBPS/foo/bar.
 /// html" will be turned into "foo/bar.html"
 /// </summary>
 /// <param name="packageHref"></param>
 /// <param name="resourcesByHref"></param>
 private static Resources fixHrefs(String packageHref, Resources resourcesByHref)
 {
     int lastSlashPos = packageHref.IndexOf('/');
     if (lastSlashPos < 0)
     {
         return resourcesByHref;
     }
     Resources result = new Resources();
     foreach (Resource resource in resourcesByHref.getAll())
     {
         if (StringUtil.isNotBlank(resource.getHref())
                 || resource.getHref().Length > lastSlashPos)
         {
             resource.setHref(resource.getHref().Substring(lastSlashPos + 1));
         }
         result.add(resource);
     }
     return result;
 }