コード例 #1
0
        /// <summary>
        /// Gets the drives.
        /// </summary>
        public IEnumerable<DriveModel> GetDrives()
        {
            var id = 0;
            var drives = GetDriveInfo();
            var model = new List<DriveModel>();
            foreach (var drive in drives)
            {
                if (!drive.IsReady)
                {
                    continue;
                }

                var driveModel = new DriveModel();
                var mapped = (DriveModel)driveModel.InjectFrom(drive);
                mapped.DriveId = id++;
                model.Add(mapped);
            }

            return model;
        }