Revision 4f6d51d4 trunk/Pithos.Client.WPF/FileProperties/FilePropertiesViewModel.cs

b/trunk/Pithos.Client.WPF/FileProperties/FilePropertiesViewModel.cs
12 12
using System.Diagnostics;
13 13
using System.Diagnostics.Contracts;
14 14
using System.Drawing;
15
using System.IO;
15 16
using System.Net;
16 17
using System.Threading.Tasks;
17 18
using System.Windows;
......
324 325
                if (IsPublic)
325 326
                    PublicUrl = String.Format("{0}/v1{1}", Shell.Accounts.First(account=>account.UserName==PithosFile.Account).SiteUri,value.PublicUrl);
326 327

  
327
                using (var icon = Icon.ExtractAssociatedIcon(LocalFileName))
328
                if (Directory.Exists(LocalFileName))
328 329
                {
329
                    FileIcon = Imaging.CreateBitmapSourceFromHIcon(icon.Handle, Int32Rect.Empty,
330
                                                                   BitmapSizeOptions.FromEmptyOptions());
330
                    FileIcon= new BitmapImage(new Uri("../Images/Folder.ico",UriKind.Relative));
331
                }
332
                else if (File.Exists(LocalFileName))
333
                {
334
                    using (var icon = Icon.ExtractAssociatedIcon(LocalFileName))
335
                    {
336
                        FileIcon = Imaging.CreateBitmapSourceFromHIcon(icon.Handle, Int32Rect.Empty,
337
                                                                       BitmapSizeOptions.FromEmptyOptions());
338
                    }
331 339
                }
332 340
                NotifyOfPropertyChange(()=>PithosFile);
333 341
                IsBusy = false;

Also available in: Unified diff