42 lines
890 B
C#
42 lines
890 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace CowainHmi
|
|
{
|
|
/// <summary>
|
|
/// 全局静态类
|
|
/// </summary>
|
|
public class GlobalData
|
|
{
|
|
private static int stationId;
|
|
|
|
public static event EventHandler<int> StationChanged;
|
|
/// <summary>
|
|
/// 工站编号
|
|
/// </summary>
|
|
public static int StationId
|
|
{
|
|
get => stationId;
|
|
set
|
|
{
|
|
stationId = value;
|
|
OnStationChanged(stationId);
|
|
}
|
|
}
|
|
|
|
private static void OnStationChanged(int stationId)
|
|
{
|
|
// 检查是否有订阅者
|
|
StationChanged?.Invoke(null, stationId);
|
|
}
|
|
|
|
public static List<string> StationNames { get; set; } = new List<string>();
|
|
|
|
|
|
|
|
}
|
|
}
|