You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: improve and consolidate interfaces (#906)
Make the following changes for the interfaces:
1. Enable [Nullable reference types](https://learn.microsoft.com/en-us/dotnet/csharp/nullable-references)
2. Improve and cleanup XML documentation and sort properties and methods in interfaces alphabetically
3. Consolidate the naming in the factory methods to always use just `New`; so instead of `new DirectoryInfo(path)` you should use `IFileSystem.DirectoryInfo.New(path)`. The previous existing factory methods were kept and marked as `Obsolete`.
4. Added a `Wrap` method to the factory interfaces that can be used instead of a direct cast (which is not possible for interfaces) to create a wrapped interface from a "System.IO" type.
5. Removed the `WriteAllLinesAsync` with array overload, as it is not defined in `System.IO` and overload resolution will automatically use the `IEnumerable` overload.
6. Added missing methods: `ResolveLinkTarget` and `CreateAsSymbolicLink`
7. Change the return type for Stream-Methods to a custom defined `FileSystemStream`.
*Note: This should fix the issues from #793 , right?*
Added the following extensibility measures:
- Add `IFileSystem FileSystem` property to more classes to enable implementing extension methods.
This was simplified by adding a base interface `IFileSystemExtensionPoint`
- Add a `IFileSystemExtensibility Extensibility` property on `IFileSystemInfo` and `IFileSystemStream` which grants access to the underlying wrapped instance or to a metadata dictionary to store additional information together with the instance.
<DefineConstantsCondition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net5.0' OR '$(TargetFramework)' == 'netcoreapp3.1' OR '$(TargetFramework)' == 'netstandard2.1'">$(DefineConstants);FEATURE_ASYNC_FILE;FEATURE_ENUMERATION_OPTIONS;FEATURE_ADVANCED_PATH_OPERATIONS;FEATURE_PATH_JOIN_WITH_SPAN</DefineConstants>
14
+
<DefineConstantsCondition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net5.0' OR '$(TargetFramework)' == 'netcoreapp3.1' OR '$(TargetFramework)' == 'netstandard2.1'">$(DefineConstants);FEATURE_ASYNC_FILE;FEATURE_ENUMERATION_OPTIONS;FEATURE_ADVANCED_PATH_OPERATIONS;FEATURE_PATH_JOIN_WITH_SPAN;FEATURE_SPAN</DefineConstants>
15
15
<DefineConstantsCondition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net5.0'">$(DefineConstants);FEATURE_FILE_MOVE_WITH_OVERWRITE;FEATURE_SUPPORTED_OS_ATTRIBUTE;FEATURE_FILE_SYSTEM_WATCHER_FILTERS;FEATURE_ENDS_IN_DIRECTORY_SEPARATOR;FEATURE_PATH_JOIN_WITH_PARAMS;FEATURE_PATH_JOIN_WITH_FOUR_PATHS</DefineConstants>
0 commit comments