public static DriveTabItem Create(string drive) { var driveInfo = FileSystem.DriveInformation(drive); var source = IconExtractor.GetDriveIcon(driveInfo.DriveType); var toolTipText = (driveInfo.IsReady ? string.Format("{0}{1}\nСвободно: {2} КБ" + "\nВсего: {3} КБ", driveInfo.VolumeLabel, driveInfo.DriveFormat, LengthFormatter.LengthFormat(driveInfo.AvailableFreeSpace), LengthFormatter.LengthFormat(driveInfo.TotalSize)) : string.Format("{0} {1}", driveInfo.DriveType, driveInfo.Name)); return(new DriveTabItem(source, drive.ToLower(), toolTipText, driveInfo.RootDirectory)); }