mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-19 09:15:50 +02:00
Fix ScriptLoader showing multiple errors at once sometimes & change error title
This commit is contained in:
parent
812a034e8d
commit
296d0c6199
@ -9,7 +9,7 @@
|
|||||||
namespace TweetDuck.Resources{
|
namespace TweetDuck.Resources{
|
||||||
static class ScriptLoader{
|
static class ScriptLoader{
|
||||||
private const string UrlPrefix = "td:";
|
private const string UrlPrefix = "td:";
|
||||||
|
|
||||||
public static string LoadResource(string name, bool silent = false, Control sync = null){
|
public static string LoadResource(string name, bool silent = false, Control sync = null){
|
||||||
try{
|
try{
|
||||||
string contents = File.ReadAllText(Path.Combine(Program.ScriptPath, name), Encoding.UTF8);
|
string contents = File.ReadAllText(Path.Combine(Program.ScriptPath, name), Encoding.UTF8);
|
||||||
@ -61,10 +61,10 @@ private static void ShowLoadError(bool silent, Control sync, string message){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sync == null){
|
if (sync == null){
|
||||||
FormMessage.Error("TweetDuck Has Failed :(", message, FormMessage.OK);
|
FormMessage.Error("Resource Error", message, FormMessage.OK);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
sync.InvokeAsyncSafe(() => FormMessage.Error("TweetDuck Has Failed :(", message, FormMessage.OK));
|
sync.InvokeSafe(() => FormMessage.Error("Resource Error", message, FormMessage.OK));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user