You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lj_plc/Main/Mesnac.Basic/InvokeHelper.cs

104 lines
2.4 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mesnac.Basic
{
/// <summary>
/// 动态调用辅助类
/// </summary>
public class InvokeHelper
{
#region 定义变量
public static object Sender = null;
#endregion
#region 定义公共委托
public delegate void DoWork();
#endregion
#region 定义公共事件
/// <summary>
/// 刷新计划事件定义
/// </summary>
public static event EventHandler OnRefreshPlan;
public static event EventHandler OnAlarmRefresh;
public static event EventHandler OnAlarmRefreshExtend;
public static event EventHandler OnRefreshRecipe;
#endregion
#region 定义公共方法
#region 触发刷新计划事件的方法
/// <summary>
/// 触发刷新计划事件的方法
/// </summary>
public static void TriggerRefreshPlanEvent()
{
if (OnRefreshPlan != null)
{
OnRefreshPlan(Sender, System.EventArgs.Empty);
}
}
#endregion
#region 触发刷新SCADA画面中报警列表的方法主监控
/// <summary>
/// 触发刷新SCADA画面中报警列表的方法主监控
/// </summary>
public static void TriggerAlarmRefreshEvent()
{
if (OnAlarmRefresh != null)
{
OnAlarmRefresh(Sender, System.EventArgs.Empty);
}
}
#endregion
#region 触发刷新SCADA画面中报警列表的方法扩展屏
/// <summary>
/// 触发刷新SCADA画面中报警列表的方法扩展屏
/// </summary>
public static void TriggerAlarmRefreshExtendEvent()
{
if (OnAlarmRefreshExtend != null)
{
OnAlarmRefreshExtend(Sender, System.EventArgs.Empty);
}
}
#endregion
#region 触发刷新配方事件的方法
/// <summary>
/// 触发刷新计划事件的方法
/// </summary>
public static void TriggerRefreshRecipeEvent()
{
if (OnRefreshPlan != null)
{
OnRefreshRecipe(Sender, System.EventArgs.Empty);
}
}
#endregion
#endregion
}
}