コード例 #1
0
        /// <summary>
        /// Create the UsbPort for the hub.
        /// </summary>
        /// <returns></returns>
        private int CreatePorts()
        {
            // Port index is 1-based
            for (int index = 1; index <= NumberOfPorts; ++index)
            {
                this[index] = new UsbPort(this, index);
            }

            return(this.NumberOfPorts);
        }
コード例 #2
0
        }     // NodeInfo

        public int CreatePorts()
        {
            // Loop through the Ports on the Hub any get the unique DriverKey if there is a device connected to
            // the Port. If the DriveryKey from the hub matches the DriverKey for our device, we have our Hub Index.
            //
            // Port index is 1-based
            for (int index = 1; index <= NumberOfPorts; ++index)
            {
                this[index] = new UsbPort(this, index);
                this[index].Refresh();
            }

            return(this.NumberOfPorts);
        }