static private GetDefaultIdentityAndHash ( object &identity, string &hash, char separator ) : void | ||
identity | object | |
hash | string | |
separator | char | |
return | void |
protected void InitStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType) { VerifyScope(scope); Scope = scope; object identity; string hash; Helper.GetDefaultIdentityAndHash(out identity, out hash, SeparatorInternal); if (Helper.IsApplication(scope)) { _applicationIdentity = identity; } else { if (Helper.IsDomain(scope)) { _domainIdentity = identity; hash = $"{hash}{SeparatorExternal}{hash}"; } _assemblyIdentity = identity; } IdentityHash = hash; }
static TestHelper() { s_rootDirectoryProperty = typeof(IsolatedStorageFile).GetProperty("RootDirectory", BindingFlags.NonPublic | BindingFlags.Instance); s_roots = new List <string>(); string hash; object identity; Helper.GetDefaultIdentityAndHash(out identity, out hash, '.'); string userRoot = Helper.GetDataDirectory(IsolatedStorageScope.User); string randomUserRoot = Helper.GetRandomDirectory(userRoot, IsolatedStorageScope.User); s_roots.Add(Path.Combine(randomUserRoot, hash)); // Application scope doesn't go under a random dir s_roots.Add(Path.Combine(userRoot, hash)); // https://github.com/dotnet/runtime/issues/2092 // https://github.com/dotnet/runtime/issues/21742 if (OperatingSystem.IsWindows() && !PlatformDetection.IsInAppContainer) { s_roots.Add(Helper.GetDataDirectory(IsolatedStorageScope.Machine)); } // We don't expose Roaming yet // Helper.GetDataDirectory(IsolatedStorageScope.Roaming); }
static TestHelper() { s_rootDirectoryProperty = typeof(IsolatedStorageFile).GetProperty("RootDirectory", BindingFlags.NonPublic | BindingFlags.Instance); s_roots = new List <string>(); string hash; object identity; Helper.GetDefaultIdentityAndHash(out identity, out hash, '.'); string userRoot = Helper.GetDataDirectory(IsolatedStorageScope.User); string randomUserRoot = Helper.GetRandomDirectory(userRoot, IsolatedStorageScope.User); s_roots.Add(Path.Combine(randomUserRoot, hash)); // Application scope doesn't go under a random dir s_roots.Add(Path.Combine(userRoot, hash)); // https://github.com/dotnet/corefx/issues/11124 // Need to implement ACLing for machine scope first // Helper.GetDataDirectory(IsolatedStorageScope.Machine); // We don't expose Roaming yet // Helper.GetDataDirectory(IsolatedStorageScope.Roaming); }