Пример #1
0
 public async Task <Sitemap> LoadAsync(Sitemap sitemap)
 {
     if (sitemap == null)
     {
         throw new ArgumentNullException(nameof(sitemap));
     }
     return(await LoadAsync(sitemap.SitemapLocation));
 }
        public static async Task <Sitemap> LoadAsync(this Sitemap sitemap, ISitemapFetcher fetcher = null, ISitemapParser parser = null)
        {
            if (sitemap == null)
            {
                throw new ArgumentNullException("sitemap");
            }

            //We are already loaded!
            if (sitemap.IsLoaded)
            {
                return(sitemap);
            }

            if (sitemap.SitemapLocation == null)
            {
                throw new InvalidOperationException("Sitemap location not specified");
            }

            var loader = new SitemapLoader(fetcher, parser);

            return(await loader.LoadAsync(sitemap));
        }
Пример #3
0
 public RobotsSitemap(Uri sitemapLocation, DateTime?lastModified = null)
 {
     _adapteeObject = new Louw.SitemapParser.Sitemap(sitemapLocation, lastModified);
 }
Пример #4
0
 public RobotsSitemap(IEnumerable <SitemapItem> items, Uri sitemapLocation = null, DateTime?lastModified = null)
 {
     _adapteeObject = new Louw.SitemapParser.Sitemap(items, sitemapLocation, lastModified);
 }
Пример #5
0
 public RobotsSitemap(Louw.SitemapParser.Sitemap adapteeObject)
 {
     _adapteeObject = adapteeObject;
 }