mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-22 18:02:16 +00:00
callback action can be fired when user closes infobox
This commit is contained in:
parent
8db3a2e11c
commit
02fd7a883b
3 changed files with 10 additions and 6 deletions
|
@ -76,12 +76,16 @@ namespace ShiftOS.WinForms.Applications
|
|||
btnok.Click += (o, a) =>
|
||||
{
|
||||
AppearanceManager.Close(this);
|
||||
OpenCallback?.Invoke();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
public void Open(string title, string msg)
|
||||
private Action OpenCallback = null;
|
||||
|
||||
public void Open(string title, string msg, Action c = null)
|
||||
{
|
||||
OpenCallback = c;
|
||||
new Dialog().OpenInternal(title, msg);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,11 +55,11 @@ 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);
|
||||
_infobox.Open(title, message, callback);
|
||||
}
|
||||
|
||||
public static void PromptText(string title, string message, Action<string> callback)
|
||||
|
@ -89,7 +89,7 @@ namespace ShiftOS.Engine
|
|||
// Infobox Interface
|
||||
public interface IInfobox
|
||||
{
|
||||
void Open(string title, string msg);
|
||||
void Open(string title, string msg, Action callback = null);
|
||||
void PromptText(string title, string message, Action<string> callback);
|
||||
void PromptYesNo(string title, string message, Action<bool> callback);
|
||||
}
|
||||
|
|
|
@ -357,9 +357,9 @@ end");
|
|||
[Exposed("infobox")]
|
||||
public class InfoboxFunctions
|
||||
{
|
||||
public void show(string title, string message)
|
||||
public void show(string title, string message, Action callback = null)
|
||||
{
|
||||
Infobox.Show(title, message);
|
||||
Infobox.Show(title, message, callback);
|
||||
}
|
||||
|
||||
public void question(string title, string message, Action<bool> callback)
|
||||
|
|
Loading…
Reference in a new issue