Changeset 11926 for extensions/PiwigoLib/PiwigoWpf/Services
- Timestamp:
- Aug 9, 2011, 6:08:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PiwigoLib/PiwigoWpf/Services/ImageCacheManager.cs
r11922 r11926 27 27 public static String GetDefaultImage() 28 28 { 29 return ("pack://application:,,,/Pictures/Globe.png"); 29 return ("pack://application:,,,/Pictures/64x64/images.png"); 30 } 31 32 public static String GetLoadImage() 33 { 34 return ("pack://application:,,,/Pictures/64x64/html.png"); 30 35 } 31 36 … … 213 218 } 214 219 215 public String GetImageFilename(PwgImageWPF aImageWPF )216 { 217 String retImgSrc = String.Empty;220 public String GetImageFilename(PwgImageWPF aImageWPF, String strImageType) 221 { 222 String retImgSrc = GetDefaultImage(); 218 223 if (aImageWPF == null) 219 224 { … … 223 228 if (_currentCategory != null) 224 229 { 225 String localFile = Path.Combine(_currentCategory.BasePath.FullName, String.Format("{0}-{1}", aImageWPF.Id, aImageWPF.File)); 230 String localDir = Path.Combine(_currentCategory.BasePath.FullName, strImageType); 231 if (!Directory.Exists(localDir)) 232 { 233 Directory.CreateDirectory(localDir); 234 } 235 236 String localFile = Path.Combine(localDir, String.Format("{0}-{1}", aImageWPF.Id, aImageWPF.File)); 226 237 227 238 if (!File.Exists(localFile)) 228 239 { 229 retImgSrc = Get DefaultImage();240 retImgSrc = GetLoadImage(); 230 241 231 242 ThreadPool.QueueUserWorkItem((WaitCallback)delegate … … 246 257 image.Save(localFile); 247 258 248 aImageWPF.ImgSource = localFile; 259 switch (strImageType) 260 { 261 case "Thumb" : 262 aImageWPF.ImgSourceThumb = localFile; 263 break; 264 case "LowRes": 265 aImageWPF.ImgSource = localFile; 266 break; 267 } 268 249 269 }); 250 270 }
Note: See TracChangeset
for help on using the changeset viewer.