Changeset 11922 for extensions/PiwigoLib/PiwigoWpf/Services
- Timestamp:
- Aug 8, 2011, 6:57:56 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PiwigoLib/PiwigoWpf/Services/ImageCacheManager.cs
r11911 r11922 39 39 static ImageCacheManager() 40 40 { 41 Int32 a, b; 42 ThreadPool.GetMaxThreads(out a, out b); 43 if (a>20) a = 20; 44 ThreadPool.SetMaxThreads(a, b); 41 45 } 42 46 … … 211 215 public String GetImageFilename(PwgImageWPF aImageWPF) 212 216 { 213 String ret Value= String.Empty;217 String retImgSrc = String.Empty; 214 218 if (aImageWPF == null) 215 219 { 216 return ret Value;220 return retImgSrc; 217 221 } 218 222 … … 223 227 if (!File.Exists(localFile)) 224 228 { 229 retImgSrc = GetDefaultImage(); 230 225 231 ThreadPool.QueueUserWorkItem((WaitCallback)delegate 226 232 { … … 240 246 image.Save(localFile); 241 247 248 aImageWPF.ImgSource = localFile; 242 249 }); 243 244 retValue = localFile; 245 } 250 } 251 else 252 { 253 retImgSrc = localFile; 254 } 255 return retImgSrc; 246 256 } 247 257 else … … 249 259 throw new ApplicationException("Current category not set before using image cache."); 250 260 } 251 return retValue;252 261 } 253 262
Note: See TracChangeset
for help on using the changeset viewer.