2017-02-27 02:04:13 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace Plane.Windows.Messages
|
|
|
|
|
{
|
|
|
|
|
public static class Message
|
|
|
|
|
{
|
|
|
|
|
private static Action<string> ShowAction { get; set; }
|
2018-11-03 10:27:25 +08:00
|
|
|
|
private static Action<bool> ConnectAction { get; set; }
|
2020-01-30 20:32:24 +08:00
|
|
|
|
private static Action<string> StatusAction { get; set; }
|
2017-02-27 02:04:13 +08:00
|
|
|
|
|
|
|
|
|
public static void Configure(Action<string> showAction)
|
|
|
|
|
{
|
|
|
|
|
ShowAction = showAction;
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-30 20:32:24 +08:00
|
|
|
|
public static void ConfigureStatus(Action<string> showAction)
|
|
|
|
|
{
|
|
|
|
|
StatusAction = showAction;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-02-27 02:04:13 +08:00
|
|
|
|
public static void Show(string message)
|
|
|
|
|
{
|
|
|
|
|
ShowAction?.Invoke(message);
|
|
|
|
|
}
|
2018-11-03 10:27:25 +08:00
|
|
|
|
|
2020-01-30 20:32:24 +08:00
|
|
|
|
public static void ShowStatus(string message)
|
|
|
|
|
{
|
|
|
|
|
StatusAction?.Invoke(message);
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-03 10:27:25 +08:00
|
|
|
|
public static void Configure(Action<bool> connectAction)
|
|
|
|
|
{
|
|
|
|
|
ConnectAction = connectAction;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void Connect(bool isConnected)
|
|
|
|
|
{
|
|
|
|
|
ConnectAction?.Invoke(isConnected);
|
|
|
|
|
}
|
2017-02-27 02:04:13 +08:00
|
|
|
|
}
|
|
|
|
|
}
|