mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
* indexer drive detection helper code to not show the warning for a single drive * removed interface from the namespace due to stylecop * removed interfac which no longer exists * filter out only fixed drives in the system and ignore the removable drives * changed text to not all files are indexed, from not all drives are idnexed * add additional info in the comment
23 lines
767 B
C#
23 lines
767 B
C#
// Copyright (c) Microsoft Corporation
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using System.IO;
|
|
using System.Linq;
|
|
|
|
namespace Microsoft.Plugin.Indexer.DriveDetection
|
|
{
|
|
public class DriveInfoWrapper : IDriveInfoWrapper
|
|
{
|
|
private static readonly int DriveCount = GetDriveInfo();
|
|
|
|
private static int GetDriveInfo()
|
|
{
|
|
// To ignore removable type drives, CD ROMS, no root partitions which may not be formatted and only return the fixed drives in the system.
|
|
return DriveInfo.GetDrives().Where(d => d.DriveType == DriveType.Fixed).Count();
|
|
}
|
|
|
|
public int GetDriveCount() => DriveCount;
|
|
}
|
|
}
|