-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display Drive detection warning only for multiple drives (#7589)
* 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
- Loading branch information
1 parent
e30393e
commit fdffe20
Showing
7 changed files
with
54 additions
and
12 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/DriveDetection/DriveInfoWrapper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// 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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Interface/IDriveInfoWrapper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// 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. | ||
|
||
namespace Microsoft.Plugin.Indexer | ||
{ | ||
public interface IDriveInfoWrapper | ||
{ | ||
int GetDriveCount(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Properties/Resources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters