Exemple #1
0
        /// <summary>
        /// Gets the devices by Type for this list.
        /// </summary>
        /// <param name="type">The Type for the devices to get.</param>
        /// <param name="recursive">True to search recursively.</param>
        /// <returns>The Devices that matched the type.</returns>
        public Devices DevicesByType(string type, bool recursive = true)
        {
            Devices ldDevices = new Devices();

            if (Type == type)
            {
                ldDevices.Add(this);
            }
            if (HasChildren)
            {
                Children.AddDevicesByType(type, ldDevices, recursive);
            }

            return(ldDevices);
        }