private void timerSpaceCheck_Tick(object sender, EventArgs e) { driveSpaceBarItem.Content = $"Free space: {DriveSpaceUtils.GetAvailableDriveSpace(_config.RecordingsFolder)}"; }
private void RefreshRecordings() { string[] files = Directory.GetFiles(_recordingPath); List <RecordingItem> recordings = new List <Utils.RecordingItem>(); foreach (string filePath in files) { if (!File.Exists(filePath)) { continue; } FileInfo info = new FileInfo(filePath); if (info.Extension.ToLower() != ".wav" && info.Extension.ToLower() != ".mp3") { continue; } string formattedDate = info.CreationTime.ToString("yyyy-MM-dd HH:mm"); System.Drawing.Image image = FileUtils.GetSmallIcon(filePath); recordings.Add(new RecordingItem(Path.GetFileNameWithoutExtension(filePath), info.Extension, info.CreationTime, DriveSpaceUtils.BytesTostring(info.Length), image, filePath)); } recordingsDataGrid.ItemsSource = recordings; }