예제 #1
0
 public static UrlCache_v1 GetUrlCache()
 {
     UrlCache_v1 urlCache = null;
     if (__useUrlCache)
         urlCache = new UrlCache_v1(__cacheDirectory, __urlFileNameType);
     return urlCache;
 }
예제 #2
0
 public static void Test_RapideDdl_LoadPostImages_01(string query = null, string sort = null, int limit = 10, bool loadImage = false)
 {
     //IEnumerable<ImageHtml> images = from image in (from post in RapideDdl_LoadPostDetail.Find(query, sort: sort, limit: limit, loadImage: loadImage) select post.images) select image;
     //IEnumerable<ImageHtml> images = from post in RapideDdl_LoadPostDetail.Find(query, sort: sort, limit: limit, loadImage: loadImage) select (from image in post.images select image);
     //RunSource.CurrentRunSource.View(from image in (from post in RapideDdl_LoadPostDetail.Find(query, sort: sort, limit: limit, loadImage: loadImage) select post.images) select image);
     //RunSource.CurrentRunSource.View(from post in RapideDdl_LoadPostDetail.Find(query, sort: sort, limit: limit, loadImage: loadImage) select (from image in post.images select image));
     //var q = RapideDdl_LoadPostDetail.Find(query, sort: sort, limit: limit, loadImage: loadImage).SelectMany(post => post.images);
     //var q = from post in RapideDdl_LoadPostDetail.Find(query, sort: sort, limit: limit, loadImage: loadImage) select (from image in post.images select image);
     //var q = from post in RapideDdl_LoadPostDetail.Find(query, sort: sort, limit: limit, loadImage: loadImage)
     //        select (from image in post.images
     //                select new { source = image.Source, title = image.Title, width = image.ImageWidth, height = image.ImageHeight, date = post.creationDate, url = post.sourceUrl });
     //var q1 = from post in RapideDdl_LoadPostDetail.Find(query, sort: sort, limit: limit, loadImage: loadImage) select (from image in post.images select image.Source);
     var q1 = from post in RapideDdl_LoadPostDetail.CurrentLoadPostDetail.FindDocuments(query, sort: sort, limit: limit, loadImage: loadImage) select (from image in post.images select image.Url);
     var q2 = q1.SelectMany(image => image).Distinct().OrderBy(image => image);
     UrlCache_v1 urlCache = new UrlCache_v1(@"c:\pib\_cacheImage", UrlFileNameType.Path | UrlFileNameType.Host, (url, requestParameters) => zurl.GetDomain(url));
     var q3 = from image in q2 select new { image = image, file = zurl.UrlToFileName(image, UrlFileNameType.Path | UrlFileNameType.Host), file2 = urlCache.GetUrlSubPath(image) };
     var q = q3;
     //RunSource.CurrentRunSource.View(q);
     q.zView();
 }