GetPLC_Data/ConsoleGetPLCData/CS/NetEvent.cs
2025-11-08 08:17:36 +08:00

59 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleGetPLCData.CS
{
public delegate void NetEvent(object sender, NetEventArgs e);
/// <summary>
/// 服务器程序的事件参数,包含了激发该事件的会话对象
/// </summary>
public class NetEventArgs : EventArgs
{
#region
/// <summary>
/// 客户端与服务器之间的会话
/// </summary>
private Session _client;
#endregion
#region
/// <summary>
/// 构造函数
/// </summary>
/// <param name="client">客户端会话</param>
public NetEventArgs(Session client)
{
if (null == client)
{
throw (new ArgumentNullException());
}
_client = client;
}
#endregion
#region
/// <summary>
/// 获得激发该事件的会话对象
/// </summary>
public Session Client
{
get
{
return _client;
}
}
#endregion
}
}