|
| 1 | +using System; |
| 2 | + |
1 | 3 | namespace PepperDash.Essentials.Core.DeviceTypeInterfaces |
2 | 4 | { |
3 | 5 | /// <summary> |
@@ -43,6 +45,58 @@ public interface INetworkSwitchPoeManager |
43 | 45 | /// </summary> |
44 | 46 | public interface INetworkSwitchPoeVlanManager : INetworkSwitchVlanManager, INetworkSwitchPoeManager |
45 | 47 | { |
| 48 | + /// <summary> |
| 49 | + /// Event that is raised when the state of a switch port changes, such as a VLAN change or PoE state change. |
| 50 | + /// </summary> |
| 51 | + event EventHandler<NetworkSwitchPortEventArgs> PortStateChanged; |
| 52 | + |
| 53 | + } |
| 54 | + |
| 55 | + /// <summary> |
| 56 | + /// Event arguments for port state changes on a network switch, such as VLAN changes or PoE state changes. |
| 57 | + /// </summary> |
| 58 | + public class NetworkSwitchPortEventArgs : EventArgs |
| 59 | + { |
| 60 | + /// <summary> |
| 61 | + /// The identifier of the port that changed state (e.g. "1/0/3" for Netgear, "gi1/0/3" for Cisco). |
| 62 | + /// </summary> |
| 63 | + public string Port { get; private set; } |
| 64 | + |
| 65 | + /// <summary> |
| 66 | + /// The type of event that occurred on the port (e.g. VLAN change, PoE enabled/disabled). |
| 67 | + /// </summary> |
| 68 | + public NetworkSwitchPortEventType EventType { get; private set; } |
| 69 | + |
| 70 | + /// <summary> |
| 71 | + /// Constructor for NetworkSwitchPortEventArgs |
| 72 | + /// </summary> |
| 73 | + /// <param name="port">The identifier of the port that changed state</param> |
| 74 | + /// <param name="eventType">The type of event that occurred on the port</param> |
| 75 | + public NetworkSwitchPortEventArgs(string port, NetworkSwitchPortEventType eventType) |
| 76 | + { |
| 77 | + Port = port; |
| 78 | + EventType = eventType; |
| 79 | + } |
| 80 | + } |
| 81 | + |
| 82 | + /// <summary> |
| 83 | + /// Event arguments for port state changes on a network switch, such as VLAN changes or PoE state changes. |
| 84 | + /// </summary> |
| 85 | + public enum NetworkSwitchPortEventType |
| 86 | + { |
| 87 | + /// <summary> |
| 88 | + /// Indicates that the access VLAN on a port has changed, either through a successful call to SetPortVlan |
| 89 | + /// </summary> |
| 90 | + VlanChanged, |
46 | 91 |
|
| 92 | + /// <summary> |
| 93 | + /// Indicates that the PoE state on a port has changed, either through a successful call to SetPortPoeState |
| 94 | + /// </summary> |
| 95 | + PoEDisabled, |
| 96 | + |
| 97 | + /// <summary> |
| 98 | + /// Indicates that the PoE state on a port has changed, either through a successful call to SetPortPoeState |
| 99 | + /// </summary> |
| 100 | + PoEEnabled |
47 | 101 | } |
48 | 102 | } |
0 commit comments