ErgCompetePM/Program.cs
/// <summary>
/// Starts polling for a found device
/// </summary>
/// <param name="args">The device details</param>
Starts polling for a found device
Starts polling for a found device
private void StartMonitoringDevice(object? _, EventArgs args)
        {
            if (args == null)
            {
                throw new ArgumentNullException(nameof(args));
            }
            if (args is not DeviceEventArgs deviceArgs)
            {
                throw new Exception("Unexpected event arguments.");
            }
            if (deviceArgs.SerialNumber == null)
            {
                _logger.LogCritical("Serial number was null when StartMonitoring was acted on.");
                return;
            }
            Console.WriteLine("Device found!");
            _activeDevices.Add(deviceArgs.SerialNumber);
        }
private void StartMonitoringDevice ( object ? _ , EventArgs args ) { if ( args == null ) { throw new ArgumentNullException ( nameof ( args ) ) ; } if ( args is not DeviceEventArgs deviceArgs ) { throw new Exception ( " " ) ; } if ( deviceArgs . SerialNumber == null ) { _logger . LogCritical ( " " ) ; return ; } Console . WriteLine ( " " ) ; _activeDevices . Add ( deviceArgs . SerialNumber ) ; }
Starts polling for a found device
Starts polling for a found device
//_pmService.StartPolling(deviceArgs.SerialNumber);
_
object?
args
EventArgs
The device details
The device details