Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make storage extensions conditional #239

Merged
merged 2 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ private static void AssertMapContains<TKey, TValue>(ConditionalWeakTable<TKey, T
}
#endif // DEBUG

#endregion Helpers

#if !NETSTANDARD2_0

private static void EnsureAdapterBufferSize(Stream adapter, int requiredBufferSize, string methodName)
{
Debug.Assert(adapter != null);
Expand All @@ -80,8 +84,6 @@ private static void EnsureAdapterBufferSize(Stream adapter, int requiredBufferSi
}
}

#endregion Helpers


#region WinRt-to-NetFx conversion

Expand Down Expand Up @@ -220,7 +222,6 @@ private static Stream AsStreamInternalFactoryHelper(object windowsruntimeStream,

#endregion WinRt-to-NetFx conversion


#region NetFx-to-WinRt conversion

public static IInputStream AsInputStream(this Stream stream)
Expand Down Expand Up @@ -332,6 +333,8 @@ private static NetFxToWinRtStreamAdapter AsWindowsRuntimeStreamInternalFactoryHe
}
#endregion NetFx-to-WinRt conversion

#endif

} // class WindowsRuntimeStreamExtensions
} // namespace

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ namespace System.IO
/// </summary>
public static class WindowsRuntimeStorageExtensions
{

#if !NETSTANDARD2_0

public static Task<Stream> OpenStreamForReadAsync(this IStorageFile windowsRuntimeFile)
{
if (windowsRuntimeFile == null)
Expand Down Expand Up @@ -171,6 +174,7 @@ private static async Task<Stream> OpenStreamForWriteAsyncCore(this IStorageFolde
return null;
}
}
#endif

public static SafeFileHandle CreateSafeFileHandle(
this IStorageFile windowsRuntimeFile,
Expand Down