/// <summary>
        /// Rescan disks.
        /// </summary>
        private async Task RescanAsync()
        {
            _diskRoster.Clear();
            DiskRosterNames.Clear();

            await SearchAsync();
        }
        /// <summary>
        /// Search disks.
        /// </summary>
        private async Task SearchAsync()
        {
            try
            {
                List <DiskInfo> diskRosterPre = null;

                // Get disk information by WMI.
                var searchTask = Task.Run(() => DiskSearcher.Search());

                try
                {
                    diskRosterPre = await searchTask;
                }
                catch (Exception ex)
                {
                    Debug.WriteLine("Failed to get disk information by WMI. {0}", ex);

                    if (searchTask.Exception != null)
                    {
                        searchTask.Exception.Flatten().InnerExceptions
                        .ToList()
                        .ForEach(x => Debug.WriteLine(x));
                    }
                }

                if (diskRosterPre == null)
                {
                    return;
                }

                // Sort by PhysicalDrive.
                diskRosterPre.Sort();

                foreach (var infoPre in diskRosterPre)
                {
                    DiskInfo infoNew = null;

                    // Add disk information by P/Invoke.
                    var physicalDrive = infoPre.PhysicalDrive;

                    var checkTask = Task.Run(() => DiskChecker.GetDiskInfo(physicalDrive));

                    try
                    {
                        infoNew = await checkTask;
                    }
                    catch (Exception ex)
                    {
                        Debug.WriteLine("Failed to get disk information by P/Invoke. {0}", ex);

                        if (checkTask.Exception != null)
                        {
                            checkTask.Exception.Flatten().InnerExceptions
                            .ToList()
                            .ForEach(x => Debug.WriteLine(x));
                        }
                    }

                    if (infoNew == null)
                    {
                        infoNew = new DiskInfo {
                            PhysicalDrive = infoPre.PhysicalDrive
                        };
                    }

                    infoNew.Model                 = infoPre.Model;
                    infoNew.InterfaceType         = infoPre.InterfaceType;
                    infoNew.MediaTypeDiskDrive    = infoPre.MediaTypeDiskDrive;
                    infoNew.MediaTypePhysicalDisk = infoPre.MediaTypePhysicalDisk;
                    infoNew.SpindleSpeed          = infoPre.SpindleSpeed;
                    infoNew.SizeWMI               = infoPre.SizeWMI;

                    // Add disk information to disk roster.
                    int index = 0;

                    if (_diskRoster.Any())
                    {
                        while ((index < _diskRoster.Count) && (infoNew.PhysicalDrive > _diskRoster[index].PhysicalDrive))
                        {
                            index++;
                        }
                    }

                    _diskRoster.Insert(index, infoNew);
                    DiskRosterNames.Insert(index, infoNew.NameBus);

                    if (index == 0)
                    {
                        DiskRosterNamesIndex = 0;
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Failed to search disks {0}", ex);
            }
        }