public void SetFullPath(string path) { if (this.FullPath != null) { FileData outs; Factory.Resolve <FolderService>().Files.TryRemove(this.FullPath, out outs); } this.FullPath = path; Factory.Resolve <FolderService>().Files.TryAdd(this.FullPath, this); this.IsDirectory = Directory.Exists(path); if (this.IsDirectory) { this.Name = new DirectoryInfo(path).Name; } else { FileInfo info = new FileInfo(path); this.Name = info.Name; this.IsHidden = info.Attributes.HasFlag(FileAttributes.Hidden); } this.Icon = new Lazy <BitmapSource>(() => IconUtil.GetIcon(this.FullPath)); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return(IconUtil.GetIcon((string)value, true, false)); }