mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 19:08:29 +00:00
feat: add event and arguments for port state changes in network switch management
This commit is contained in:
parent
8817d70f07
commit
76311b83ff
1 changed files with 54 additions and 0 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -43,6 +45,58 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface INetworkSwitchPoeVlanManager : INetworkSwitchVlanManager, INetworkSwitchPoeManager
|
public interface INetworkSwitchPoeVlanManager : INetworkSwitchVlanManager, INetworkSwitchPoeManager
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Event that is raised when the state of a switch port changes, such as a VLAN change or PoE state change.
|
||||||
|
/// </summary>
|
||||||
|
event EventHandler<NetworkSwitchPortEventArgs> PortStateChanged;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Event arguments for port state changes on a network switch, such as VLAN changes or PoE state changes.
|
||||||
|
/// </summary>
|
||||||
|
public class NetworkSwitchPortEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The identifier of the port that changed state (e.g. "1/0/3" for Netgear, "gi1/0/3" for Cisco).
|
||||||
|
/// </summary>
|
||||||
|
public string Port { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The type of event that occurred on the port (e.g. VLAN change, PoE enabled/disabled).
|
||||||
|
/// </summary>
|
||||||
|
public NetworkSwitchPortEventType EventType { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor for NetworkSwitchPortEventArgs
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="port">The identifier of the port that changed state</param>
|
||||||
|
/// <param name="eventType">The type of event that occurred on the port</param>
|
||||||
|
public NetworkSwitchPortEventArgs(string port, NetworkSwitchPortEventType eventType)
|
||||||
|
{
|
||||||
|
Port = port;
|
||||||
|
EventType = eventType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Event arguments for port state changes on a network switch, such as VLAN changes or PoE state changes.
|
||||||
|
/// </summary>
|
||||||
|
public enum NetworkSwitchPortEventType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that the access VLAN on a port has changed, either through a successful call to SetPortVlan
|
||||||
|
/// </summary>
|
||||||
|
VlanChanged,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that the PoE state on a port has changed, either through a successful call to SetPortPoeState
|
||||||
|
/// </summary>
|
||||||
|
PoEDisabled,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that the PoE state on a port has changed, either through a successful call to SetPortPoeState
|
||||||
|
/// </summary>
|
||||||
|
PoEEnabled
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue