Ejemplo n.º 1
0
        object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var size = (long)Convert.ChangeType(value, typeof(long));
            var str  = FsInfoFormat.FormatFileSize(size);

            return(str);
        }
Ejemplo n.º 2
0
        public override void Refresh()
        {
            this.DriveInfo = new DriveInfo(Path.GetPathRoot(this.DirInfo.FullName));

            this.Icon = FsInfoFormat.GetFsItemIcon(this.DirInfo.FullName, true, out var descr);
            if (string.IsNullOrWhiteSpace(this.DriveInfo.VolumeLabel))
            {
                this.VolumeDescription = descr;
            }
            else
            {
                this.VolumeDescription = this.DriveInfo.VolumeLabel + ":" + descr;
            }


            this.RaizePropertyChanged("DriveInfo");
            this.RaizePropertyChanged("VolumeDescription");
            this.RaizePropertyChanged("Icon");

            base.Refresh();
        }
Ejemplo n.º 3
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value is string filePath && File.Exists(filePath))
     {
         return(FsInfoFormat.GetFsItemIcon(filePath, this.Small, out var descr));
     }