Skip to content

Commit

Permalink
#74642 made IsolatedStorageDirectoryName const
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhamoyan authored and github-actions committed Sep 27, 2022
1 parent 6a13bbc commit d460ec8
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="System\IO\IsolatedStorage\IsolatedStorageException.cs" />
<Compile Include="System\IO\IsolatedStorage\IsolatedStorageFile.cs" />
<Compile Condition="'$(TargetPlatformIdentifier)' == 'Android' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst' or '$(TargetPlatformIdentifier)' == 'tvOS'"
Include="System\IO\IsolatedStorage\IsolatedStorageFile.AnyMobile.cs" />
<Compile Condition="'$(TargetPlatformIdentifier)' != 'Android' and '$(TargetPlatformIdentifier)' != 'iOS' and '$(TargetPlatformIdentifier)' != 'MacCatalyst' and '$(TargetPlatformIdentifier)' != 'tvOS'"
Include="System\IO\IsolatedStorage\IsolatedStorageFile.NonMobile.cs" />
<Compile Include="System\IO\IsolatedStorage\IsolatedStorageFile.cs" />
<Compile Include="System\IO\IsolatedStorage\IsolatedStorageFileStream.cs" />
<Compile Include="System\IO\IsolatedStorage\IsolatedStorage.cs" />
<Compile Include="System\IO\IsolatedStorage\IsolatedStorageScope.cs" />
Expand All @@ -23,6 +19,14 @@
<Compile Include="$(CommonPath)System\Security\IdentityHelper.cs"
Link="Common\System\Security\IdentityHelper.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'Android' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst' or '$(TargetPlatformIdentifier)' == 'tvOS'">
<Compile Include="System\IO\IsolatedStorage\Helper.AnyMobile.cs" />
<Compile Include="System\IO\IsolatedStorage\IsolatedStorageFile.AnyMobile.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != 'Android' and '$(TargetPlatformIdentifier)' != 'iOS' and '$(TargetPlatformIdentifier)' != 'MacCatalyst' and '$(TargetPlatformIdentifier)' != 'tvOS'">
<Compile Include="System\IO\IsolatedStorage\Helper.NonMobile.cs" />
<Compile Include="System\IO\IsolatedStorage\IsolatedStorageFile.NonMobile.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
<Compile Include="System\IO\IsolatedStorage\Helper.Win32.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.IO.IsolatedStorage
{
internal static partial class Helper
{
public const string IsolatedStorageDirectoryName = ".isolated-storage";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.IO.IsolatedStorage
{
internal static partial class Helper
{
public const string IsolatedStorageDirectoryName = "IsolatedStorage";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ namespace System.IO.IsolatedStorage
{
internal static partial class Helper
{
public static string IsolatedStorageDirectoryName { get; set;} = "IsolatedStorage";

private static string? s_machineRootDirectory;
private static string? s_roamingUserRootDirectory;
private static string? s_userRootDirectory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ namespace System.IO.IsolatedStorage
{
public sealed partial class IsolatedStorageFile : IsolatedStorage, IDisposable
{

private static void InitializeIsoStorageDirectoryName()
{
Helper.IsolatedStorageDirectoryName = ".isolated-storage";
}

private string GetIsolatedStorageRoot()
{
return Helper.GetRootDirectory(Scope);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ namespace System.IO.IsolatedStorage
{
public sealed partial class IsolatedStorageFile : IsolatedStorage, IDisposable
{
private static void InitializeIsoStorageDirectoryName()
{
Helper.IsolatedStorageDirectoryName = "IsolatedStorage";
}

private string GetIsolatedStorageRoot()
{
StringBuilder root = new StringBuilder(Helper.GetRootDirectory(Scope));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ internal IsolatedStorageFile(IsolatedStorageScope scope)
// Evidence isn't currently available: https://github.com/dotnet/runtime/issues/18208
// public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, Evidence domainEvidence, Type domainEvidenceType, Evidence assemblyEvidence, Type assemblyEvidenceType) { return default(IsolatedStorageFile); }

// for non mobile platforms IsolatedStorageDirectoryName is "IsolatedStorage", for mobile platforms ".isolated-storage"
InitializeIsoStorageDirectoryName();

// InitStore will set up the IdentityHash
InitStore(scope, null, null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,16 @@
<Compile Include="System\IO\IsolatedStorage\MoveDirectoryTests.cs" />
<Compile Include="System\IO\IsolatedStorage\MoveFileTests.cs" />
<Compile Include="System\IO\IsolatedStorage\OpenFileTests.cs" />
<Compile Include="System\IO\IsolatedStorage\TestHelper.cs" />
<Compile Condition="'$(TargetPlatformIdentifier)' == 'Android' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst' or '$(TargetPlatformIdentifier)' == 'tvOS'"
Include="System\IO\IsolatedStorage\TestHelper.AnyMobile.cs" />
<Compile Condition="'$(TargetPlatformIdentifier)' != 'Android' and '$(TargetPlatformIdentifier)' != 'iOS' and '$(TargetPlatformIdentifier)' != 'MacCatalyst' and '$(TargetPlatformIdentifier)' != 'tvOS'"
Include="System\IO\IsolatedStorage\TestHelper.NonMobile.cs" />
<Compile Include="System\IO\IsolatedStorage\TestHelper.cs" />
<Compile Include="System\IO\IsolatedStorage\RemoveTests.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'Android' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst' or '$(TargetPlatformIdentifier)' == 'tvOS'">
<Compile Include="..\src\System\IO\IsolatedStorage\Helper.AnyMobile.cs" />
<Compile Include="System\IO\IsolatedStorage\TestHelper.AnyMobile.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != 'Android' and '$(TargetPlatformIdentifier)' != 'iOS' and '$(TargetPlatformIdentifier)' != 'MacCatalyst' and '$(TargetPlatformIdentifier)' != 'tvOS'">
<Compile Include="..\src\System\IO\IsolatedStorage\Helper.NonMobile.cs" />
<Compile Include="System\IO\IsolatedStorage\TestHelper.NonMobile.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)System.DirectoryServices\src\System.DirectoryServices.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public static partial class TestHelper
private static List<string> GetRoots()
{
List<string> roots = new List<string>();
Helper.IsolatedStorageDirectoryName = ".isolated-storage";
string userRoot = Helper.GetDataDirectory(IsolatedStorageScope.User);
string randomUserRoot = Helper.GetRandomDirectory(userRoot, IsolatedStorageScope.User);
roots.Add(randomUserRoot);
Expand Down

0 comments on commit d460ec8

Please sign in to comment.