internal Bus(usb_bus nativeBus) { this.nativeBus = nativeBus; this.descriptors = new DescriptorCollection(); for (usb_device dev = nativeBus.Devices; dev != null; dev = dev.Next) { descriptors.Add(new Descriptor(dev)); } }
/// <summary> /// Initializes a new instance of <see cref='DescriptorEnumerator'/>. /// </summary> public DescriptorEnumerator(DescriptorCollection mappings) { this.temp = ((IEnumerable)(mappings)); this.baseEnumerator = temp.GetEnumerator(); }
/// <summary> /// Initializes a new instance of <see cref='DescriptorCollection'/> based on another <see cref='DescriptorCollection'/>. /// </summary> /// <param name='val'> /// A <see cref='DescriptorCollection'/> from which the contents are copied /// </param> public DescriptorCollection(DescriptorCollection val) { this.AddRange(val); }
/// <summary> /// Adds the contents of another <see cref='DescriptorCollection'/> to the end of the collection. /// </summary> /// <param name='val'> /// A <see cref='DescriptorCollection'/> containing the objects to add to the collection. /// </param> /// <seealso cref='DescriptorCollection.Add'/> public void AddRange(DescriptorCollection val) { for (int i = 0; i < val.Count; i++) { this.Add(val[i]); } }