コード例 #1
0
 /// <summary>
 /// Creates a new DeviceMonitor event with the specified characteristics.
 /// </summary>
 /// <param name="eventType"> The type of event (ARRIVAL | DEPARTURE) </param>
 /// <param name="source"> The monitor which generated the event </param>
 /// <param name="adapter"> The DSPortAdapter the monitor was using </param>
 /// <param name="addresses"> Vector of addresses for devices </param>
 internal DeviceMonitorEvent(int eventType, AbstractDeviceMonitor source, DSPortAdapter adapter, List <long> addresses)
 {
     if (eventType != ARRIVAL && eventType != DEPARTURE)
     {
         throw new System.ArgumentException("Invalid event type: " + eventType);
     }
     this.eventType      = eventType;
     this.monitor        = source;
     this.adapter        = adapter;
     this.vDeviceAddress = addresses;
 }
コード例 #2
0
        /// <summary>
        /// Returns the OneWireContainer for the address at the specified index
        /// </summary>
        /// <returns> the OneWireContainer for the address at the specified index </returns>
        public virtual OneWireContainer getContainerAt(int index)
        {
            long?longAddress = (long?)this.vDeviceAddress[index];

            return(AbstractDeviceMonitor.getDeviceContainer(adapter, longAddress.Value));
        }
コード例 #3
0
 /// <summary>
 /// Creates a new DeviceMonitor event with the specified characteristics.
 /// </summary>
 /// <param name="source"> The monitor which generated the exception </param>
 /// <param name="adapter"> The DSPortAdapter the monitor was using </param>
 /// <param name="exception"> The actual exception which was thrown </param>
 internal DeviceMonitorException(AbstractDeviceMonitor deviceMonitor, DSPortAdapter adapter, Exception exception) : base("Device Monitor Exception")
 {
     this.deviceMonitor = deviceMonitor;
     this.adapter       = adapter;
     this.exception     = exception;
 }