private async void ButtonNewQuizOnClick() { if (_sData != null && _sData.HasAnyInput()) { UIWindowMessage window = await UIWindowManager.Instance.GetWindow(SystemDefine.UI_WINDOW_NAME_MESSAGE) as UIWindowMessage; UIWindowMessage.MessageCmd cmd = new UIWindowMessage.MessageCmd(); cmd.Type = UIWindowMessage.MessageType.YesNo; cmd.Title = "Are you sure to generate new quiz ?"; cmd.ActionYes = async() => { UIWindowManager.Instance.CloseWindow(SystemDefine.UI_WINDOW_NAME_MESSAGE).DoNotAwait(); ShowDifficultyWindow(); }; cmd.ActionNo = () => { UIWindowManager.Instance.CloseWindow(SystemDefine.UI_WINDOW_NAME_MESSAGE).DoNotAwait(); }; window.SetInfo(cmd); window.Show(true, false).DoNotAwait(); return; } ShowDifficultyWindow(); }
private async void ButtonShowSolutionOnClick() { UIWindowMessage window = await UIWindowManager.Instance.GetWindow(SystemDefine.UI_WINDOW_NAME_MESSAGE) as UIWindowMessage; UIWindowMessage.MessageCmd cmd = new UIWindowMessage.MessageCmd(); cmd.Type = UIWindowMessage.MessageType.YesNo; cmd.Title = "Are you sure to show all solutions ?"; cmd.ActionYes = async() => { UIWindowManager.Instance.CloseWindow(SystemDefine.UI_WINDOW_NAME_MESSAGE).DoNotAwait(); if (_sData.IsSolvable()) { _sData.FillAllSolution(); _selectingInput = null; Refresh(); } }; cmd.ActionNo = () => { UIWindowManager.Instance.CloseWindow(SystemDefine.UI_WINDOW_NAME_MESSAGE).DoNotAwait(); }; window.SetInfo(cmd); window.Show(true, false).DoNotAwait(); }
public async void ButtonResetOnClick() { UIWindowMessage window = await UIWindowManager.Instance.GetWindow(SystemDefine.UI_WINDOW_NAME_MESSAGE) as UIWindowMessage; if (window == null) { return; } UIWindowMessage.MessageCmd cmd = new UIWindowMessage.MessageCmd(); cmd.Type = UIWindowMessage.MessageType.YesNo; cmd.Title = "Are you sure to reset all slot ?"; cmd.ActionYes = () => { ResetData(); ResetUI(); UIWindowManager.Instance.CloseWindow(SystemDefine.UI_WINDOW_NAME_MESSAGE).DoNotAwait(); }; cmd.ActionNo = () => { UIWindowManager.Instance.CloseWindow(SystemDefine.UI_WINDOW_NAME_MESSAGE).DoNotAwait(); }; window.SetInfo(cmd); window.Show(true, false).DoNotAwait(); }