diff --git a/ShareX.HelpersLib/Helpers/Helpers.cs b/ShareX.HelpersLib/Helpers/Helpers.cs index 8d4fdab2e..d651dcbc9 100644 --- a/ShareX.HelpersLib/Helpers/Helpers.cs +++ b/ShareX.HelpersLib/Helpers/Helpers.cs @@ -705,13 +705,13 @@ public static void PlaySoundAsync(Stream stream) } } - public static void PlaySoundAsync(string filepath) + public static void PlaySoundAsync(string filePath) { - if (!string.IsNullOrEmpty(filepath) && File.Exists(filepath)) + if (!string.IsNullOrEmpty(filePath) && File.Exists(filePath)) { Task.Run(() => { - using (SoundPlayer soundPlayer = new SoundPlayer(filepath)) + using (SoundPlayer soundPlayer = new SoundPlayer(filePath)) { soundPlayer.PlaySync(); } diff --git a/ShareX.HelpersLib/Helpers/ImageHelpers.cs b/ShareX.HelpersLib/Helpers/ImageHelpers.cs index 14e0fa065..66ba5b546 100644 --- a/ShareX.HelpersLib/Helpers/ImageHelpers.cs +++ b/ShareX.HelpersLib/Helpers/ImageHelpers.cs @@ -1916,11 +1916,11 @@ public static Bitmap LoadImage(string filePath) public static Bitmap LoadImageWithFileDialog() { - string filepath = OpenImageFileDialog(); + string filePath = OpenImageFileDialog(); - if (!string.IsNullOrEmpty(filepath)) + if (!string.IsNullOrEmpty(filePath)) { - return LoadImage(filepath); + return LoadImage(filePath); } return null; diff --git a/ShareX.MediaLib/VideoThumbnailInfo.cs b/ShareX.MediaLib/VideoThumbnailInfo.cs index 326db5f00..84ae6b255 100644 --- a/ShareX.MediaLib/VideoThumbnailInfo.cs +++ b/ShareX.MediaLib/VideoThumbnailInfo.cs @@ -30,17 +30,17 @@ namespace ShareX.MediaLib { public class VideoThumbnailInfo { - public string Filepath { get; set; } + public string FilePath { get; set; } public TimeSpan Timestamp { get; set; } - public VideoThumbnailInfo(string filepath) + public VideoThumbnailInfo(string filePath) { - Filepath = filepath; + FilePath = filePath; } public override string ToString() { - return Path.GetFileName(Filepath); + return Path.GetFileName(FilePath); } } } \ No newline at end of file diff --git a/ShareX.MediaLib/VideoThumbnailer.cs b/ShareX.MediaLib/VideoThumbnailer.cs index 1efb36555..f1ac65eb7 100644 --- a/ShareX.MediaLib/VideoThumbnailer.cs +++ b/ShareX.MediaLib/VideoThumbnailer.cs @@ -128,14 +128,14 @@ private List Finish(List tempThumbnails) { using (Image img = CombineScreenshots(tempThumbnails)) { - string tempFilepath = Path.Combine(GetOutputDirectory(), Path.GetFileNameWithoutExtension(MediaPath) + Options.FilenameSuffix + "." + Options.ImageFormat.GetDescription()); - ImageHelpers.SaveImage(img, tempFilepath); - thumbnails.Add(new VideoThumbnailInfo(tempFilepath)); + string tempFilePath = Path.Combine(GetOutputDirectory(), Path.GetFileNameWithoutExtension(MediaPath) + Options.FilenameSuffix + "." + Options.ImageFormat.GetDescription()); + ImageHelpers.SaveImage(img, tempFilePath); + thumbnails.Add(new VideoThumbnailInfo(tempFilePath)); } if (!Options.KeepScreenshots) { - tempThumbnails.ForEach(x => File.Delete(x.Filepath)); + tempThumbnails.ForEach(x => File.Delete(x.FilePath)); } } else @@ -145,7 +145,7 @@ private List Finish(List tempThumbnails) if (Options.OpenDirectory && thumbnails.Count > 0) { - Helpers.OpenFolderWithFile(thumbnails[0].Filepath); + Helpers.OpenFolderWithFile(thumbnails[0].FilePath); } } @@ -219,7 +219,7 @@ private Image CombineScreenshots(List thumbnails) foreach (VideoThumbnailInfo thumbnail in thumbnails) { - Bitmap bmp = ImageHelpers.LoadImage(thumbnail.Filepath); + Bitmap bmp = ImageHelpers.LoadImage(thumbnail.FilePath); if (Options.MaxThumbnailWidth > 0 && bmp.Width > Options.MaxThumbnailWidth) { diff --git a/ShareX.ScreenCaptureLib/Shapes/Drawing/ImageFileDrawingShape.cs b/ShareX.ScreenCaptureLib/Shapes/Drawing/ImageFileDrawingShape.cs index 435bfcc00..39c5555e4 100644 --- a/ShareX.ScreenCaptureLib/Shapes/Drawing/ImageFileDrawingShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/Drawing/ImageFileDrawingShape.cs @@ -60,9 +60,9 @@ private bool OpenImageDialog(bool centerImage) { Manager.IsMoving = false; Manager.Form.Pause(); - string filepath = ImageHelpers.OpenImageFileDialog(Manager.Form); + string filePath = ImageHelpers.OpenImageFileDialog(Manager.Form); Manager.Form.Resume(); - return LoadImageFile(filepath, centerImage); + return LoadImageFile(filePath, centerImage); } private bool LoadImageFile(string filePath, bool centerImage) diff --git a/ShareX/IntegrationHelpers.cs b/ShareX/IntegrationHelpers.cs index 26544e5a3..f151e2e07 100644 --- a/ShareX/IntegrationHelpers.cs +++ b/ShareX/IntegrationHelpers.cs @@ -309,9 +309,9 @@ public static void CreateChromeExtensionSupport(bool create) } } - private static void CreateChromeHostManifest(string filepath) + private static void CreateChromeHostManifest(string filePath) { - Helpers.CreateDirectoryFromFilePath(filepath); + Helpers.CreateDirectoryFromFilePath(filePath); ChromeManifest manifest = new ChromeManifest() { @@ -324,7 +324,7 @@ private static void CreateChromeHostManifest(string filepath) string json = JsonConvert.SerializeObject(manifest, Formatting.Indented); - File.WriteAllText(filepath, json, Encoding.UTF8); + File.WriteAllText(filePath, json, Encoding.UTF8); } private static void RegisterChromeExtensionSupport() @@ -379,9 +379,9 @@ public static void CreateFirefoxAddonSupport(bool create) } } - private static void CreateFirefoxHostManifest(string filepath) + private static void CreateFirefoxHostManifest(string filePath) { - Helpers.CreateDirectoryFromFilePath(filepath); + Helpers.CreateDirectoryFromFilePath(filePath); FirefoxManifest manifest = new FirefoxManifest() { @@ -394,7 +394,7 @@ private static void CreateFirefoxHostManifest(string filepath) string json = JsonConvert.SerializeObject(manifest, Formatting.Indented); - File.WriteAllText(filepath, json, Encoding.UTF8); + File.WriteAllText(filePath, json, Encoding.UTF8); } private static void RegisterFirefoxAddonSupport() diff --git a/ShareX/TaskHelpers.cs b/ShareX/TaskHelpers.cs index d073a1849..5f602297c 100644 --- a/ShareX/TaskHelpers.cs +++ b/ShareX/TaskHelpers.cs @@ -598,33 +598,33 @@ private static void AddExternalProgramFromRegistry(TaskSettings taskSettings, st public static string HandleExistsFile(string folder, string fileName, TaskSettings taskSettings) { - string filepath = Path.Combine(folder, fileName); - return HandleExistsFile(filepath, taskSettings); + string filePath = Path.Combine(folder, fileName); + return HandleExistsFile(filePath, taskSettings); } - public static string HandleExistsFile(string filepath, TaskSettings taskSettings) + public static string HandleExistsFile(string filePath, TaskSettings taskSettings) { - if (File.Exists(filepath)) + if (File.Exists(filePath)) { switch (taskSettings.ImageSettings.FileExistAction) { case FileExistAction.Ask: - using (FileExistForm form = new FileExistForm(filepath)) + using (FileExistForm form = new FileExistForm(filePath)) { form.ShowDialog(); - filepath = form.FilePath; + filePath = form.FilePath; } break; case FileExistAction.UniqueName: - filepath = Helpers.GetUniqueFilePath(filepath); + filePath = Helpers.GetUniqueFilePath(filePath); break; case FileExistAction.Cancel: - filepath = ""; + filePath = ""; break; } } - return filepath; + return filePath; } public static void OpenDropWindow(TaskSettings taskSettings = null) @@ -853,7 +853,7 @@ public static void OpenVideoThumbnailer(TaskSettings taskSettings = null) { foreach (VideoThumbnailInfo thumbnailInfo in thumbnails) { - UploadManager.UploadFile(thumbnailInfo.Filepath, taskSettings); + UploadManager.UploadFile(thumbnailInfo.FilePath, taskSettings); } } }; diff --git a/ShareX/TaskManager.cs b/ShareX/TaskManager.cs index e7a73dd8d..df2afa961 100644 --- a/ShareX/TaskManager.cs +++ b/ShareX/TaskManager.cs @@ -167,8 +167,8 @@ private static void Task_UploadStarted(WorkerTask task) { TaskInfo info = task.Info; - string status = string.Format("Upload started. Filename: {0}", info.FileName); - if (!string.IsNullOrEmpty(info.FilePath)) status += ", Filepath: " + info.FilePath; + string status = string.Format("Upload started. File name: {0}", info.FileName); + if (!string.IsNullOrEmpty(info.FilePath)) status += ", File path: " + info.FilePath; DebugHelper.WriteLine(status); ListViewItem lvi = TaskListView.FindItem(task); @@ -289,7 +289,7 @@ private static void Task_TaskCompleted(WorkerTask task) if (task.Status == TaskStatus.Stopped) { - DebugHelper.WriteLine($"Task stopped. Filename: {info.FileName}"); + DebugHelper.WriteLine($"Task stopped. File name: {info.FileName}"); if (lvi != null) { @@ -302,7 +302,7 @@ private static void Task_TaskCompleted(WorkerTask task) { string errors = string.Join("\r\n\r\n", info.Result.Errors.ToArray()); - DebugHelper.WriteLine($"Task failed. Filename: {info.FileName}, Errors:\r\n{errors}"); + DebugHelper.WriteLine($"Task failed. File name: {info.FileName}, Errors:\r\n{errors}"); if (lvi != null) { @@ -332,7 +332,7 @@ private static void Task_TaskCompleted(WorkerTask task) } else { - DebugHelper.WriteLine($"Task completed. Filename: {info.FileName}, Duration: {(long)info.TaskDuration.TotalMilliseconds} ms"); + DebugHelper.WriteLine($"Task completed. File name: {info.FileName}, Duration: {(long)info.TaskDuration.TotalMilliseconds} ms"); string result = info.ToString();