aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/Infobox.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS_TheReturn/Infobox.cs')
-rw-r--r--ShiftOS_TheReturn/Infobox.cs25
1 files changed, 17 insertions, 8 deletions
diff --git a/ShiftOS_TheReturn/Infobox.cs b/ShiftOS_TheReturn/Infobox.cs
index 3e8fa30..62abcb7 100644
--- a/ShiftOS_TheReturn/Infobox.cs
+++ b/ShiftOS_TheReturn/Infobox.cs
@@ -55,25 +55,34 @@ namespace ShiftOS.Engine
/// </summary>
/// <param name="title">Infobox title</param>
/// <param name="message">Infobox message</param>
- public static void Show(string title, string message)
+ public static void Show(string title, string message, Action callback = null)
{
title = Localization.Parse(title);
message = Localization.Parse(message);
- _infobox.Open(title, message);
+ Desktop.InvokeOnWorkerThread(() =>
+ {
+ _infobox.Open(title, message, callback);
+ });
}
-
- public static void PromptText(string title, string message, Action<string> callback)
+
+ public static void PromptText(string title, string message, Action<string> callback, bool isPassword = false)
{
title = Localization.Parse(title);
message = Localization.Parse(message);
- _infobox.PromptText(title, message, callback);
+ Desktop.InvokeOnWorkerThread(() =>
+ {
+ _infobox.PromptText(title, message, callback, isPassword);
+ });
}
public static void PromptYesNo(string title, string message, Action<bool> callback)
{
title = Localization.Parse(title);
message = Localization.Parse(message);
- _infobox.PromptYesNo(title, message, callback);
+ Desktop.InvokeOnWorkerThread(() =>
+ {
+ _infobox.PromptYesNo(title, message, callback);
+ });
}
/// <summary>
@@ -89,8 +98,8 @@ namespace ShiftOS.Engine
// Infobox Interface
public interface IInfobox
{
- void Open(string title, string msg);
- void PromptText(string title, string message, Action<string> callback);
+ void Open(string title, string msg, Action callback = null);
+ void PromptText(string title, string message, Action<string> callback, bool isPassword);
void PromptYesNo(string title, string message, Action<bool> callback);
}
}