Rename variables

This commit is contained in:
Jaex 2022-01-05 10:44:18 +03:00
parent 50707de4d8
commit 46e8387766
8 changed files with 39 additions and 39 deletions

View file

@ -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();
}

View file

@ -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;

View file

@ -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);
}
}
}

View file

@ -128,14 +128,14 @@ private List<VideoThumbnailInfo> Finish(List<VideoThumbnailInfo> 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<VideoThumbnailInfo> Finish(List<VideoThumbnailInfo> 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<VideoThumbnailInfo> 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)
{

View file

@ -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)

View file

@ -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()

View file

@ -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);
}
}
};