private void UpdateInformationLabels() { lblCurrentDbSize.Text = GeneralConverters.FormatFileSizeToString(_thumbnailService.GetThumbnailDbSize()); int thumbnailItems = _thumbnailService.GetNumberOfCachedThumbnails(); lblCachedItems.Text = thumbnailItems > 0 ? _thumbnailService.GetNumberOfCachedThumbnails().ToString() : "n/a"; }
private string GetDriveInfoListItemText(DriveInfo driveInfo) { string driveInfoText = driveInfo.VolumeLabel ?? ""; if (!string.IsNullOrEmpty(driveInfo.Name)) { driveInfoText += string.Format(" ({0}) ", driveInfo.Name.Replace("\\", "")); } else { driveInfoText += " [" + driveInfo.VolumeLabel + "]"; } driveInfoText += string.Format("{0} free of {1} [{2}, {3}]", GeneralConverters.FormatFileSizeToString(driveInfo.TotalFreeSpace), GeneralConverters.FormatFileSizeToString(driveInfo.TotalSize), driveInfo.DriveType, driveInfo.DriveFormat); return(driveInfoText); }
private void UpdateCacheStats() { long cacheSize = _selectedCacheSize; long cacheUsage = _imageCacheService.CacheSize; const long maxSize = ImageCacheService.MaxCacheSize; const long minSize = ImageCacheService.MinCacheSize; pbarPercentUsed.Maximum = (int)cacheSize; lblCacheItems.Text = _imageCacheService.CachedImages.ToString(); lblUsedSpace.Text = GeneralConverters.FormatFileSizeToString(cacheUsage, 2); lblFreeSpace.Text = GeneralConverters.FormatFileSizeToString(cacheSize - cacheUsage); pbarPercentUsed.Value = Convert.ToInt32((double)cacheUsage / cacheSize * 100); trackBarCacheSize.Minimum = Convert.ToInt32(minSize / TrackbarDivider); trackBarCacheSize.Maximum = Convert.ToInt32(maxSize / TrackbarDivider); trackBarCacheSize.Value = Convert.ToInt32(cacheSize / TrackbarDivider); UpdateCacheSizeLabel(); }
private void frmDriveInfo_Load(object sender, EventArgs e) { if (this.currentFileSystemDrive != null) { string[] items = new string[2]; items[0] = "DriveLetter"; items[1] = this.currentFileSystemDrive.DriveLetter; this.driveInfoListView.Items.Add(new ListViewItem(items)); items = new string[2]; items[0] = "VolumeLabel"; items[1] = this.currentFileSystemDrive.VolumeLabel; this.driveInfoListView.Items.Add(new ListViewItem(items)); items = new string[2]; items[0] = "DriveType"; items[1] = this.currentFileSystemDrive.DriveType.ToString(); this.driveInfoListView.Items.Add(new ListViewItem(items)); items = new string[2]; items[0] = "FreeSpace"; items[1] = GeneralConverters.FormatFileSizeToString(this.currentFileSystemDrive.FreeSpace); this.driveInfoListView.Items.Add(new ListViewItem(items)); items = new string[2]; items[0] = "TotalSpace"; items[1] = GeneralConverters.FormatFileSizeToString(this.currentFileSystemDrive.TotalSpace); this.driveInfoListView.Items.Add(new ListViewItem(items)); items = new string[2]; items[0] = "Root directory count"; items[1] = this.currentFileSystemDrive.DirectoryList.Count.ToString(); this.driveInfoListView.Items.Add(new ListViewItem(items)); items = new string[2]; items[0] = "Root file count"; items[1] = this.currentFileSystemDrive.RootFileList.Count.ToString(); this.driveInfoListView.Items.Add(new ListViewItem(items)); } }
private void UpdateCacheSizeLabel() { lblCacheSize.Text = GeneralConverters.FormatFileSizeToString(trackBarCacheSize.Value * TrackbarDivider, 0); }
private void UpdateFileHashStatus(object sender, FileHashEventArgs e) { lblFileHashesRunning.Text = Math.Max(0, _hashComputeCount).ToString(); if (e.FileName == null) { lblFileHashInfo.Text = ""; } else { lblFileHashInfo.Text = GeneralConverters.GetFileNameFromPath(e.FileName) + " - " + GeneralConverters.FormatFileSizeToString(e.FileSize); } }