Alert.cs 838 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * 使用示例:
  3. AlertSystem.Show("喜欢吗!")
  4. .SetTitle("温馨提示")
  5. .SetLeftButton(true, "喜欢", (object data1) =>
  6. {
  7. })
  8. .SetRightButton(true, "不喜欢")
  9. .SetData("aa");
  10. */
  11. namespace GFGGame.Launcher
  12. {
  13. public class Alert
  14. {
  15. private static AlertWindow _alertWindow;
  16. public static IAlert Show(string message)
  17. {
  18. if (_alertWindow == null)
  19. {
  20. _alertWindow = new AlertWindow();
  21. }
  22. _alertWindow.Reset();
  23. _alertWindow.SetMessage(message);
  24. _alertWindow.Show();
  25. return _alertWindow;
  26. }
  27. public static void Hide()
  28. {
  29. if (_alertWindow != null)
  30. {
  31. _alertWindow.Hide();
  32. }
  33. }
  34. }
  35. }