mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-01 04:30:49 +12:00
Try catch extract
This commit is contained in:
parent
d4bd293bbe
commit
e01f8304b4
|
@ -106,7 +106,7 @@ public void EditorMode()
|
|||
btnClose.Text = Resources.ImageEffectsForm_EditorMode_Cancel;
|
||||
}
|
||||
|
||||
public void ImportImageEffectFromFilePath(string filePath)
|
||||
public void ImportImageEffectFromFile(string filePath)
|
||||
{
|
||||
eiImageEffects.ImportFile(filePath);
|
||||
}
|
||||
|
|
|
@ -1056,14 +1056,14 @@ public void UseCommandLineArgs(List<CLICommand> commands)
|
|||
{
|
||||
if (command.Command.Equals("CustomUploader", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
TaskHelpers.AddCustomUploader(command.Parameter);
|
||||
TaskHelpers.ImportCustomUploader(command.Parameter);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (command.Command.Equals("ImageEffect", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
TaskHelpers.AddImageEffect(command.Parameter);
|
||||
TaskHelpers.ImportImageEffect(command.Parameter);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -1588,7 +1588,7 @@ public static Screenshot GetScreenshot(TaskSettings taskSettings = null)
|
|||
return screenshot;
|
||||
}
|
||||
|
||||
public static void AddCustomUploader(string filePath)
|
||||
public static void ImportCustomUploader(string filePath)
|
||||
{
|
||||
if (Program.UploadersConfig != null)
|
||||
{
|
||||
|
@ -1688,9 +1688,18 @@ public static void AddCustomUploader(string filePath)
|
|||
}
|
||||
}
|
||||
|
||||
public static void AddImageEffect(string filePath)
|
||||
public static void ImportImageEffect(string filePath)
|
||||
{
|
||||
string configFilePath = ImageEffectPackager.ExtractPackage(filePath, Program.ImageEffectsFolder);
|
||||
string configFilePath = null;
|
||||
|
||||
try
|
||||
{
|
||||
configFilePath = ImageEffectPackager.ExtractPackage(filePath, Program.ImageEffectsFolder);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ex.ShowError();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(configFilePath) && File.Exists(configFilePath))
|
||||
{
|
||||
|
@ -1698,7 +1707,7 @@ public static void AddImageEffect(string filePath)
|
|||
|
||||
if (imageEffectsForm != null)
|
||||
{
|
||||
imageEffectsForm.ImportImageEffectFromFilePath(configFilePath);
|
||||
imageEffectsForm.ImportImageEffectFromFile(configFilePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue