Description
Description
We are often in need of identifying an item's type, whether it be folder, file, images or anything really.
Currently, we have rogue tests to do this work for us repeated separately in the code. For example when it comes to identify shortcuts :
OpenPath(...) in NavigationHelpers:
path.EndsWith(".lnk", StringComparison.Ordinal) || path.EndsWith(".url", StringComparison.Ordinal);
ToStorageItem(...) in StorageHelpers
if (path.EndsWith(".lnk", StringComparison.OrdinalIgnoreCase) || path.EndsWith(".url", StringComparison.OrdinalIgnoreCase))
FileExtensionHelpers.cs
defines a bunch of methods that are cattled to such ends. We should enrich it and make its use wider.
Concerned code
All the codebase.
Gains
- Reduction of duplication.
- Regrouping of same logic inside a given class
Requirements
FileExtensionHelpers.cs
used more when identifying item's type.
Comments
No response
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
✅ Done