Exemplo n.º 1
0
		public new static List<IUsbDriveInfo> GetDrives()
		{
			var drives = new List<IUsbDriveInfo>();

			var uDisks = new UDisks();
			// ReSharper disable LoopCanBeConvertedToQuery
			foreach (string device in uDisks.EnumerateDeviceOnInterface("usb"))
			// ReSharper restore LoopCanBeConvertedToQuery
			{
				var deviceInfo = new UsbDriveInfoUDisks(device);
				if (deviceInfo.IsReady)
				{
					drives.Add(deviceInfo);
				}
			}
			return drives;
		}
Exemplo n.º 2
0
        public new static List <IUsbDriveInfo> GetDrives()
        {
            var drives = new List <IUsbDriveInfo>();

            var uDisks = new UDisks();

            // ReSharper disable LoopCanBeConvertedToQuery
            foreach (string device in uDisks.EnumerateDeviceOnInterface("usb"))
            // ReSharper restore LoopCanBeConvertedToQuery
            {
                var deviceInfo = new UsbDriveInfoUDisks(device);
                if (deviceInfo.IsReady)
                {
                    drives.Add(deviceInfo);
                }
            }
            return(drives);
        }