scripts
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.IO.IsolatedStorage
|
||||
{
|
||||
/// <summary>Enables comparisons between an isolated store and an application domain and assembly's evidence.</summary>
|
||||
// Token: 0x0200019F RID: 415
|
||||
[ComVisible(true)]
|
||||
public interface INormalizeForIsolatedStorage
|
||||
{
|
||||
/// <summary>When overridden in a derived class, returns a normalized copy of the object on which it is called.</summary>
|
||||
/// <returns>A normalized object that represents the instance on which this method was called. This instance can be a string, stream, or any serializable object.</returns>
|
||||
// Token: 0x0600152F RID: 5423
|
||||
object Normalize();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
using System.Security.Permissions;
|
||||
|
||||
namespace System.IO.IsolatedStorage
|
||||
{
|
||||
/// <summary>Represents the abstract base class from which all isolated storage implementations must derive.</summary>
|
||||
// Token: 0x020001A0 RID: 416
|
||||
[ComVisible(true)]
|
||||
public abstract class IsolatedStorage : MarshalByRefObject
|
||||
{
|
||||
/// <summary>Gets an application identity that scopes isolated storage.</summary>
|
||||
/// <returns>An <see cref="T:System.Object" /> that represents the <see cref="F:System.IO.IsolatedStorage.IsolatedStorageScope.Application" /> identity.</returns>
|
||||
/// <exception cref="T:System.Security.SecurityException">The code lacks the required <see cref="T:System.Security.Permissions.SecurityPermission" /> to access this object. These permissions are granted by the runtime based on security policy. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.IO.IsolatedStorage.IsolatedStorage" /> object is not isolated by the application <see cref="T:System.IO.IsolatedStorage.IsolatedStorageScope" />. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlPolicy" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x170003C3 RID: 963
|
||||
// (get) Token: 0x06001531 RID: 5425 RVA: 0x00051404 File Offset: 0x0004F604
|
||||
[ComVisible(false)]
|
||||
[MonoTODO("requires manifest support")]
|
||||
public object ApplicationIdentity
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((this.storage_scope & IsolatedStorageScope.Application) == IsolatedStorageScope.None)
|
||||
{
|
||||
throw new InvalidOperationException(Locale.GetText("Invalid Isolation Scope."));
|
||||
}
|
||||
if (this._applicationIdentity == null)
|
||||
{
|
||||
throw new InvalidOperationException(Locale.GetText("Identity unavailable."));
|
||||
}
|
||||
throw new NotImplementedException(Locale.GetText("CAS related"));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets an assembly identity used to scope isolated storage.</summary>
|
||||
/// <returns>An <see cref="T:System.Object" /> that represents the <see cref="T:System.Reflection.Assembly" /> identity.</returns>
|
||||
/// <exception cref="T:System.Security.SecurityException">The code lacks the required <see cref="T:System.Security.Permissions.SecurityPermission" /> to access this object. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The assembly is not defined.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlPolicy" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x170003C4 RID: 964
|
||||
// (get) Token: 0x06001532 RID: 5426 RVA: 0x0005145C File Offset: 0x0004F65C
|
||||
public object AssemblyIdentity
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((this.storage_scope & IsolatedStorageScope.Assembly) == IsolatedStorageScope.None)
|
||||
{
|
||||
throw new InvalidOperationException(Locale.GetText("Invalid Isolation Scope."));
|
||||
}
|
||||
if (this._assemblyIdentity == null)
|
||||
{
|
||||
throw new InvalidOperationException(Locale.GetText("Identity unavailable."));
|
||||
}
|
||||
return this._assemblyIdentity;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value representing the current size of isolated storage.</summary>
|
||||
/// <returns>The number of storage units currently used within the isolated storage scope.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The current size of the isolated store is undefined. </exception>
|
||||
// Token: 0x170003C5 RID: 965
|
||||
// (get) Token: 0x06001533 RID: 5427 RVA: 0x000514A8 File Offset: 0x0004F6A8
|
||||
[CLSCompliant(false)]
|
||||
public virtual ulong CurrentSize
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new InvalidOperationException(Locale.GetText("IsolatedStorage does not have a preset CurrentSize."));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a domain identity that scopes isolated storage.</summary>
|
||||
/// <returns>An <see cref="T:System.Object" /> that represents the <see cref="F:System.IO.IsolatedStorage.IsolatedStorageScope.Domain" /> identity.</returns>
|
||||
/// <exception cref="T:System.Security.SecurityException">The code lacks the required <see cref="T:System.Security.Permissions.SecurityPermission" /> to access this object. These permissions are granted by the runtime based on security policy. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.IO.IsolatedStorage.IsolatedStorage" /> object is not isolated by the domain <see cref="T:System.IO.IsolatedStorage.IsolatedStorageScope" />. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlPolicy" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x170003C6 RID: 966
|
||||
// (get) Token: 0x06001534 RID: 5428 RVA: 0x000514BC File Offset: 0x0004F6BC
|
||||
public object DomainIdentity
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((this.storage_scope & IsolatedStorageScope.Domain) == IsolatedStorageScope.None)
|
||||
{
|
||||
throw new InvalidOperationException(Locale.GetText("Invalid Isolation Scope."));
|
||||
}
|
||||
if (this._domainIdentity == null)
|
||||
{
|
||||
throw new InvalidOperationException(Locale.GetText("Identity unavailable."));
|
||||
}
|
||||
return this._domainIdentity;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value representing the maximum amount of space available for isolated storage. When overridden in a derived class, this value can take different units of measure.</summary>
|
||||
/// <returns>The maximum amount of isolated storage space in bytes. Derived classes can return different units of value.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The quota has not been defined. </exception>
|
||||
// Token: 0x170003C7 RID: 967
|
||||
// (get) Token: 0x06001535 RID: 5429 RVA: 0x00051508 File Offset: 0x0004F708
|
||||
[CLSCompliant(false)]
|
||||
public virtual ulong MaximumSize
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new InvalidOperationException(Locale.GetText("IsolatedStorage does not have a preset MaximumSize."));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets an <see cref="T:System.IO.IsolatedStorage.IsolatedStorageScope" /> enumeration value specifying the scope used to isolate the store.</summary>
|
||||
/// <returns>A bitwise combination of <see cref="T:System.IO.IsolatedStorage.IsolatedStorageScope" /> values specifying the scope used to isolate the store.</returns>
|
||||
// Token: 0x170003C8 RID: 968
|
||||
// (get) Token: 0x06001536 RID: 5430 RVA: 0x0005151C File Offset: 0x0004F71C
|
||||
public IsolatedStorageScope Scope
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.storage_scope;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a backslash character that can be used in a directory string. When overridden in a derived class, another character might be returned.</summary>
|
||||
/// <returns>The default implementation returns the '\' (backslash) character.</returns>
|
||||
// Token: 0x170003C9 RID: 969
|
||||
// (get) Token: 0x06001537 RID: 5431 RVA: 0x00051524 File Offset: 0x0004F724
|
||||
protected virtual char SeparatorExternal
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.DirectorySeparatorChar;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a period character that can be used in a directory string. When overridden in a derived class, another character might be returned.</summary>
|
||||
/// <returns>The default implementation returns the '.' (period) character.</returns>
|
||||
// Token: 0x170003CA RID: 970
|
||||
// (get) Token: 0x06001538 RID: 5432 RVA: 0x0005152C File Offset: 0x0004F72C
|
||||
protected virtual char SeparatorInternal
|
||||
{
|
||||
get
|
||||
{
|
||||
return '.';
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>When implemented by a derived class, returns a permission that represents access to isolated storage from within a permission set.</summary>
|
||||
/// <returns>An <see cref="T:System.Security.Permissions.IsolatedStoragePermission" /> object.</returns>
|
||||
/// <param name="ps">The <see cref="T:System.Security.PermissionSet" /> object that contains the set of permissions granted to code attempting to use isolated storage. </param>
|
||||
// Token: 0x06001539 RID: 5433
|
||||
protected abstract IsolatedStoragePermission GetPermission(PermissionSet ps);
|
||||
|
||||
/// <summary>Initializes a new <see cref="T:System.IO.IsolatedStorage.IsolatedStorage" /> object.</summary>
|
||||
/// <param name="scope">A bitwise combination of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageScope" /> values. </param>
|
||||
/// <param name="domainEvidenceType">The type of <see cref="T:System.Security.Policy.Evidence" /> that you can choose from the list of <see cref="T:System.Security.Policy.Evidence" /> present in the domain of the calling application. null lets the <see cref="T:System.IO.IsolatedStorage.IsolatedStorage" /> object choose the evidence. </param>
|
||||
/// <param name="assemblyEvidenceType">The type of <see cref="T:System.Security.Policy.Evidence" /> that you can choose from the list of <see cref="T:System.Security.Policy.Evidence" /> present in the assembly of the calling application. null lets the <see cref="T:System.IO.IsolatedStorage.IsolatedStorage" /> object choose the evidence. </param>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">The assembly specified has insufficient permissions to create isolated stores. </exception>
|
||||
// Token: 0x0600153A RID: 5434 RVA: 0x00051530 File Offset: 0x0004F730
|
||||
protected void InitStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType)
|
||||
{
|
||||
switch (scope)
|
||||
{
|
||||
case IsolatedStorageScope.User | IsolatedStorageScope.Assembly:
|
||||
case IsolatedStorageScope.User | IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly:
|
||||
throw new NotImplementedException(scope.ToString());
|
||||
}
|
||||
throw new ArgumentException(scope.ToString());
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new <see cref="T:System.IO.IsolatedStorage.IsolatedStorage" /> object.</summary>
|
||||
/// <param name="scope">A bitwise combination of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageScope" /> values. </param>
|
||||
/// <param name="appEvidenceType">The type of <see cref="T:System.Security.Policy.Evidence" /> that you can choose from the list of <see cref="T:System.Security.Policy.Evidence" /> for the calling application. null lets the <see cref="T:System.IO.IsolatedStorage.IsolatedStorage" /> object choose the evidence. </param>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">The assembly specified has insufficient permissions to create isolated stores. </exception>
|
||||
// Token: 0x0600153B RID: 5435 RVA: 0x0005157C File Offset: 0x0004F77C
|
||||
[MonoTODO("requires manifest support")]
|
||||
protected void InitStore(IsolatedStorageScope scope, Type appEvidenceType)
|
||||
{
|
||||
if (AppDomain.CurrentDomain.ApplicationIdentity == null)
|
||||
{
|
||||
throw new IsolatedStorageException(Locale.GetText("No ApplicationIdentity available for AppDomain."));
|
||||
}
|
||||
if (appEvidenceType == null)
|
||||
{
|
||||
}
|
||||
this.storage_scope = scope;
|
||||
}
|
||||
|
||||
/// <summary>When overridden in a derived class, removes the individual isolated store and all contained data.</summary>
|
||||
// Token: 0x0600153C RID: 5436
|
||||
public abstract void Remove();
|
||||
|
||||
// Token: 0x0400061D RID: 1565
|
||||
internal IsolatedStorageScope storage_scope;
|
||||
|
||||
// Token: 0x0400061E RID: 1566
|
||||
internal object _assemblyIdentity;
|
||||
|
||||
// Token: 0x0400061F RID: 1567
|
||||
internal object _domainIdentity;
|
||||
|
||||
// Token: 0x04000620 RID: 1568
|
||||
internal object _applicationIdentity;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace System.IO.IsolatedStorage
|
||||
{
|
||||
/// <summary>The exception that is thrown when an operation in isolated storage fails.</summary>
|
||||
// Token: 0x020001A1 RID: 417
|
||||
[ComVisible(true)]
|
||||
[Serializable]
|
||||
public class IsolatedStorageException : Exception
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageException" /> class with default properties.</summary>
|
||||
// Token: 0x0600153D RID: 5437 RVA: 0x000515B8 File Offset: 0x0004F7B8
|
||||
public IsolatedStorageException()
|
||||
: base(Locale.GetText("An Isolated storage operation failed."))
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageException" /> class with a specified error message.</summary>
|
||||
/// <param name="message">The error message that explains the reason for the exception. </param>
|
||||
// Token: 0x0600153E RID: 5438 RVA: 0x000515CC File Offset: 0x0004F7CC
|
||||
public IsolatedStorageException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageException" /> class with a specified error message and a reference to the inner exception that is the cause of this exception.</summary>
|
||||
/// <param name="message">The error message that explains the reason for the exception. </param>
|
||||
/// <param name="inner">The exception that is the cause of the current exception. If the <paramref name="inner" /> parameter is not null, the current exception is raised in a catch block that handles the inner exception. </param>
|
||||
// Token: 0x0600153F RID: 5439 RVA: 0x000515D8 File Offset: 0x0004F7D8
|
||||
public IsolatedStorageException(string message, Exception inner)
|
||||
: base(message, inner)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageException" /> class with serialized data.</summary>
|
||||
/// <param name="info">The object that holds the serialized object data. </param>
|
||||
/// <param name="context">The contextual information about the source or destination. </param>
|
||||
// Token: 0x06001540 RID: 5440 RVA: 0x000515E4 File Offset: 0x0004F7E4
|
||||
protected IsolatedStorageException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,918 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Security;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Permissions;
|
||||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Mono.Security.Cryptography;
|
||||
|
||||
namespace System.IO.IsolatedStorage
|
||||
{
|
||||
/// <summary>Represents an isolated storage area containing files and directories.</summary>
|
||||
// Token: 0x020001A2 RID: 418
|
||||
[ComVisible(true)]
|
||||
public sealed class IsolatedStorageFile : IsolatedStorage, IDisposable
|
||||
{
|
||||
// Token: 0x06001541 RID: 5441 RVA: 0x000515F0 File Offset: 0x0004F7F0
|
||||
private IsolatedStorageFile(IsolatedStorageScope scope)
|
||||
{
|
||||
this.storage_scope = scope;
|
||||
}
|
||||
|
||||
// Token: 0x06001542 RID: 5442 RVA: 0x00051600 File Offset: 0x0004F800
|
||||
internal IsolatedStorageFile(IsolatedStorageScope scope, string location)
|
||||
{
|
||||
this.storage_scope = scope;
|
||||
this.directory = new DirectoryInfo(location);
|
||||
if (!this.directory.Exists)
|
||||
{
|
||||
string text = Locale.GetText("Invalid storage.");
|
||||
throw new IsolatedStorageException(text);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the enumerator for the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> stores within an isolated storage scope.</summary>
|
||||
/// <returns>Enumerator for the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> stores within the specified isolated storage scope.</returns>
|
||||
/// <param name="scope">Represents the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageScope" /> for which to return isolated stores. User and User|Roaming are the only IsolatedStorageScope combinations supported. </param>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001544 RID: 5444 RVA: 0x00051654 File Offset: 0x0004F854
|
||||
public static IEnumerator GetEnumerator(IsolatedStorageScope scope)
|
||||
{
|
||||
IsolatedStorageFile.Demand(scope);
|
||||
if (scope != IsolatedStorageScope.User && scope != (IsolatedStorageScope.User | IsolatedStorageScope.Roaming) && scope != IsolatedStorageScope.Machine)
|
||||
{
|
||||
string text = Locale.GetText("Invalid scope, only User, User|Roaming and Machine are valid");
|
||||
throw new ArgumentException(text);
|
||||
}
|
||||
return new IsolatedStorageFileEnumerator(scope, IsolatedStorageFile.GetIsolatedStorageRoot(scope));
|
||||
}
|
||||
|
||||
/// <summary>Obtains isolated storage corresponding to the given application domain and the assembly evidence objects and types.</summary>
|
||||
/// <returns>An <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> object representing the parameters.</returns>
|
||||
/// <param name="scope">A bitwise combination of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageScope" /> values. </param>
|
||||
/// <param name="domainEvidence">An <see cref="T:System.Security.Policy.Evidence" /> object containing the application domain identity. </param>
|
||||
/// <param name="domainEvidenceType">The identity <see cref="T:System.Type" /> to choose from the application domain evidence. </param>
|
||||
/// <param name="assemblyEvidence">An <see cref="T:System.Security.Policy.Evidence" /> object containing the code assembly identity. </param>
|
||||
/// <param name="assemblyEvidenceType">The identity <see cref="T:System.Type" /> to choose from the application code assembly evidence. </param>
|
||||
/// <exception cref="T:System.Security.SecurityException">Sufficient isolated storage permissions have not been granted. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="domainEvidence" /> or <paramref name="assemblyEvidence" /> identity has not been passed in. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="scope" /> is invalid. </exception>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">An isolated storage location cannot be initialized.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001545 RID: 5445 RVA: 0x000516A8 File Offset: 0x0004F8A8
|
||||
public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, Evidence domainEvidence, Type domainEvidenceType, Evidence assemblyEvidence, Type assemblyEvidenceType)
|
||||
{
|
||||
IsolatedStorageFile.Demand(scope);
|
||||
bool flag = (scope & IsolatedStorageScope.Domain) != IsolatedStorageScope.None;
|
||||
if (flag && domainEvidence == null)
|
||||
{
|
||||
throw new ArgumentNullException("domainEvidence");
|
||||
}
|
||||
bool flag2 = (scope & IsolatedStorageScope.Assembly) != IsolatedStorageScope.None;
|
||||
if (flag2 && assemblyEvidence == null)
|
||||
{
|
||||
throw new ArgumentNullException("assemblyEvidence");
|
||||
}
|
||||
IsolatedStorageFile isolatedStorageFile = new IsolatedStorageFile(scope);
|
||||
if (flag)
|
||||
{
|
||||
if (domainEvidenceType == null)
|
||||
{
|
||||
isolatedStorageFile._domainIdentity = IsolatedStorageFile.GetDomainIdentityFromEvidence(domainEvidence);
|
||||
}
|
||||
else
|
||||
{
|
||||
isolatedStorageFile._domainIdentity = IsolatedStorageFile.GetTypeFromEvidence(domainEvidence, domainEvidenceType);
|
||||
}
|
||||
if (isolatedStorageFile._domainIdentity == null)
|
||||
{
|
||||
throw new IsolatedStorageException(Locale.GetText("Couldn't find domain identity."));
|
||||
}
|
||||
}
|
||||
if (flag2)
|
||||
{
|
||||
if (assemblyEvidenceType == null)
|
||||
{
|
||||
isolatedStorageFile._assemblyIdentity = IsolatedStorageFile.GetAssemblyIdentityFromEvidence(assemblyEvidence);
|
||||
}
|
||||
else
|
||||
{
|
||||
isolatedStorageFile._assemblyIdentity = IsolatedStorageFile.GetTypeFromEvidence(assemblyEvidence, assemblyEvidenceType);
|
||||
}
|
||||
if (isolatedStorageFile._assemblyIdentity == null)
|
||||
{
|
||||
throw new IsolatedStorageException(Locale.GetText("Couldn't find assembly identity."));
|
||||
}
|
||||
}
|
||||
isolatedStorageFile.PostInit();
|
||||
return isolatedStorageFile;
|
||||
}
|
||||
|
||||
/// <summary>Obtains the isolated storage corresponding to the given application domain and assembly evidence objects.</summary>
|
||||
/// <returns>An <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> representing the parameters.</returns>
|
||||
/// <param name="scope">A bitwise combination of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageScope" /> values. </param>
|
||||
/// <param name="domainIdentity">An <see cref="T:System.Object" /> that contains evidence for the application domain identity. </param>
|
||||
/// <param name="assemblyIdentity">An <see cref="T:System.Object" /> that contains evidence for the code assembly identity. </param>
|
||||
/// <exception cref="T:System.Security.SecurityException">Sufficient isolated storage permissions have not been granted. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">Neither the <paramref name="domainIdentity" /> nor <paramref name="assemblyIdentity" /> have been passed in. This verifies that the correct constructor is being used.-or- Either <paramref name="domainIdentity" /> or <paramref name="assemblyIdentity" /> are null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="scope" /> is invalid. </exception>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">An isolated storage location cannot be initialized.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001546 RID: 5446 RVA: 0x00051798 File Offset: 0x0004F998
|
||||
public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, object domainIdentity, object assemblyIdentity)
|
||||
{
|
||||
IsolatedStorageFile.Demand(scope);
|
||||
if ((scope & IsolatedStorageScope.Domain) != IsolatedStorageScope.None && domainIdentity == null)
|
||||
{
|
||||
throw new ArgumentNullException("domainIdentity");
|
||||
}
|
||||
bool flag = (scope & IsolatedStorageScope.Assembly) != IsolatedStorageScope.None;
|
||||
if (flag && assemblyIdentity == null)
|
||||
{
|
||||
throw new ArgumentNullException("assemblyIdentity");
|
||||
}
|
||||
IsolatedStorageFile isolatedStorageFile = new IsolatedStorageFile(scope);
|
||||
if (flag)
|
||||
{
|
||||
isolatedStorageFile._fullEvidences = Assembly.GetCallingAssembly().UnprotectedGetEvidence();
|
||||
}
|
||||
isolatedStorageFile._domainIdentity = domainIdentity;
|
||||
isolatedStorageFile._assemblyIdentity = assemblyIdentity;
|
||||
isolatedStorageFile.PostInit();
|
||||
return isolatedStorageFile;
|
||||
}
|
||||
|
||||
/// <summary>Obtains isolated storage corresponding to the isolated storage scope given the application domain and assembly evidence types.</summary>
|
||||
/// <returns>An <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> object representing the parameters.</returns>
|
||||
/// <param name="scope">A bitwise combination of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageScope" /> values. </param>
|
||||
/// <param name="domainEvidenceType">The type of the <see cref="T:System.Security.Policy.Evidence" /> that you can chose from the list of <see cref="T:System.Security.Policy.Evidence" /> present in the domain of the calling application. null lets the <see cref="T:System.IO.IsolatedStorage.IsolatedStorage" /> object choose the evidence. </param>
|
||||
/// <param name="assemblyEvidenceType">The type of the <see cref="T:System.Security.Policy.Evidence" /> that you can chose from the list of <see cref="T:System.Security.Policy.Evidence" /> present in the domain of the calling application. null lets the <see cref="T:System.IO.IsolatedStorage.IsolatedStorage" /> object choose the evidence. </param>
|
||||
/// <exception cref="T:System.Security.SecurityException">Sufficient isolated storage permissions have not been granted. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="scope" /> is invalid. </exception>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">The evidence type provided is missing in the assembly evidence list. -or-An isolated storage location cannot be initialized.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001547 RID: 5447 RVA: 0x00051818 File Offset: 0x0004FA18
|
||||
public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType)
|
||||
{
|
||||
IsolatedStorageFile.Demand(scope);
|
||||
IsolatedStorageFile isolatedStorageFile = new IsolatedStorageFile(scope);
|
||||
if ((scope & IsolatedStorageScope.Domain) != IsolatedStorageScope.None)
|
||||
{
|
||||
if (domainEvidenceType == null)
|
||||
{
|
||||
domainEvidenceType = typeof(Url);
|
||||
}
|
||||
isolatedStorageFile._domainIdentity = IsolatedStorageFile.GetTypeFromEvidence(AppDomain.CurrentDomain.Evidence, domainEvidenceType);
|
||||
}
|
||||
if ((scope & IsolatedStorageScope.Assembly) != IsolatedStorageScope.None)
|
||||
{
|
||||
Evidence evidence = Assembly.GetCallingAssembly().UnprotectedGetEvidence();
|
||||
isolatedStorageFile._fullEvidences = evidence;
|
||||
if ((scope & IsolatedStorageScope.Domain) != IsolatedStorageScope.None)
|
||||
{
|
||||
if (assemblyEvidenceType == null)
|
||||
{
|
||||
assemblyEvidenceType = typeof(Url);
|
||||
}
|
||||
isolatedStorageFile._assemblyIdentity = IsolatedStorageFile.GetTypeFromEvidence(evidence, assemblyEvidenceType);
|
||||
}
|
||||
else
|
||||
{
|
||||
isolatedStorageFile._assemblyIdentity = IsolatedStorageFile.GetAssemblyIdentityFromEvidence(evidence);
|
||||
}
|
||||
}
|
||||
isolatedStorageFile.PostInit();
|
||||
return isolatedStorageFile;
|
||||
}
|
||||
|
||||
/// <summary>Obtains isolated storage corresponding to the given application identity.</summary>
|
||||
/// <returns>An <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> object representing the parameters.</returns>
|
||||
/// <param name="scope">A bitwise combination of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageScope" /> values. </param>
|
||||
/// <param name="applicationIdentity">An <see cref="T:System.Object" /> that contains evidence for the application identity. </param>
|
||||
/// <exception cref="T:System.Security.SecurityException">Sufficient isolated storage permissions have not been granted. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="applicationEvidence" /> identity has not been passed in. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="scope" /> is invalid. </exception>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">An isolated storage location cannot be initialized.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001548 RID: 5448 RVA: 0x000518BC File Offset: 0x0004FABC
|
||||
public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, object applicationIdentity)
|
||||
{
|
||||
IsolatedStorageFile.Demand(scope);
|
||||
if (applicationIdentity == null)
|
||||
{
|
||||
throw new ArgumentNullException("applicationIdentity");
|
||||
}
|
||||
IsolatedStorageFile isolatedStorageFile = new IsolatedStorageFile(scope);
|
||||
isolatedStorageFile._applicationIdentity = applicationIdentity;
|
||||
isolatedStorageFile._fullEvidences = Assembly.GetCallingAssembly().UnprotectedGetEvidence();
|
||||
isolatedStorageFile.PostInit();
|
||||
return isolatedStorageFile;
|
||||
}
|
||||
|
||||
/// <summary>Obtains isolated storage corresponding to the isolation scope and the application identity object.</summary>
|
||||
/// <returns>An <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> object representing the parameters.</returns>
|
||||
/// <param name="scope">A bitwise combination of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageScope" /> values. </param>
|
||||
/// <param name="applicationEvidenceType">An <see cref="T:System.Security.Policy.Evidence" /> object containing the application identity. </param>
|
||||
/// <exception cref="T:System.Security.SecurityException">Sufficient isolated storage permissions have not been granted. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="domainEvidence" /> or <paramref name="assemblyEvidence" /> identity has not been passed in. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="scope" /> is invalid. </exception>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">An isolated storage location cannot be initialized.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001549 RID: 5449 RVA: 0x00051908 File Offset: 0x0004FB08
|
||||
public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, Type applicationEvidenceType)
|
||||
{
|
||||
IsolatedStorageFile.Demand(scope);
|
||||
IsolatedStorageFile isolatedStorageFile = new IsolatedStorageFile(scope);
|
||||
isolatedStorageFile.InitStore(scope, applicationEvidenceType);
|
||||
isolatedStorageFile._fullEvidences = Assembly.GetCallingAssembly().UnprotectedGetEvidence();
|
||||
isolatedStorageFile.PostInit();
|
||||
return isolatedStorageFile;
|
||||
}
|
||||
|
||||
/// <summary>Obtains machine-scoped isolated storage corresponding to the calling code's application identity.</summary>
|
||||
/// <returns>An <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> object corresponding to the isolated storage scope based on the calling code's application identity.</returns>
|
||||
/// <exception cref="T:System.Security.SecurityException">Sufficient isolated storage permissions have not been granted. </exception>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">The application identity of the caller cannot be determined.-or- The granted permission set for the <see cref="T:System.AppDomain" /> cannot be determined.-or-An isolated storage location cannot be initialized.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600154A RID: 5450 RVA: 0x00051944 File Offset: 0x0004FB44
|
||||
public static IsolatedStorageFile GetMachineStoreForApplication()
|
||||
{
|
||||
IsolatedStorageScope isolatedStorageScope = IsolatedStorageScope.Machine | IsolatedStorageScope.Application;
|
||||
IsolatedStorageFile isolatedStorageFile = new IsolatedStorageFile(isolatedStorageScope);
|
||||
isolatedStorageFile.InitStore(isolatedStorageScope, null);
|
||||
isolatedStorageFile._fullEvidences = Assembly.GetCallingAssembly().UnprotectedGetEvidence();
|
||||
isolatedStorageFile.PostInit();
|
||||
return isolatedStorageFile;
|
||||
}
|
||||
|
||||
/// <summary>Obtains machine-scoped isolated storage corresponding to the calling code's assembly identity.</summary>
|
||||
/// <returns>An <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> object corresponding to the isolated storage scope based on the calling code's assembly identity.</returns>
|
||||
/// <exception cref="T:System.Security.SecurityException">Sufficient isolated storage permissions have not been granted. </exception>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">An isolated storage location cannot be initialized.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600154B RID: 5451 RVA: 0x0005197C File Offset: 0x0004FB7C
|
||||
public static IsolatedStorageFile GetMachineStoreForAssembly()
|
||||
{
|
||||
IsolatedStorageScope isolatedStorageScope = IsolatedStorageScope.Assembly | IsolatedStorageScope.Machine;
|
||||
IsolatedStorageFile isolatedStorageFile = new IsolatedStorageFile(isolatedStorageScope);
|
||||
Evidence evidence = Assembly.GetCallingAssembly().UnprotectedGetEvidence();
|
||||
isolatedStorageFile._fullEvidences = evidence;
|
||||
isolatedStorageFile._assemblyIdentity = IsolatedStorageFile.GetAssemblyIdentityFromEvidence(evidence);
|
||||
isolatedStorageFile.PostInit();
|
||||
return isolatedStorageFile;
|
||||
}
|
||||
|
||||
/// <summary>Obtains machine-scoped isolated storage corresponding to the application domain identity and the assembly identity.</summary>
|
||||
/// <returns>An <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> object corresponding to the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageScope" />, based on a combination of the application domain identity and the assembly identity.</returns>
|
||||
/// <exception cref="T:System.Security.SecurityException">Sufficient isolated storage permissions have not been granted. </exception>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">The store failed to open.-or- The assembly specified has insufficient permissions to create isolated stores.-or-An isolated storage location cannot be initialized. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600154C RID: 5452 RVA: 0x000519B8 File Offset: 0x0004FBB8
|
||||
public static IsolatedStorageFile GetMachineStoreForDomain()
|
||||
{
|
||||
IsolatedStorageScope isolatedStorageScope = IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly | IsolatedStorageScope.Machine;
|
||||
IsolatedStorageFile isolatedStorageFile = new IsolatedStorageFile(isolatedStorageScope);
|
||||
isolatedStorageFile._domainIdentity = IsolatedStorageFile.GetDomainIdentityFromEvidence(AppDomain.CurrentDomain.Evidence);
|
||||
Evidence evidence = Assembly.GetCallingAssembly().UnprotectedGetEvidence();
|
||||
isolatedStorageFile._fullEvidences = evidence;
|
||||
isolatedStorageFile._assemblyIdentity = IsolatedStorageFile.GetAssemblyIdentityFromEvidence(evidence);
|
||||
isolatedStorageFile.PostInit();
|
||||
return isolatedStorageFile;
|
||||
}
|
||||
|
||||
/// <summary>Obtains user-scoped isolated storage corresponding to the calling code's application identity.</summary>
|
||||
/// <returns>An <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> object corresponding to the isolated storage scope based on the calling code's assembly identity.</returns>
|
||||
/// <exception cref="T:System.Security.SecurityException">Sufficient isolated storage permissions have not been granted. </exception>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">An isolated storage location cannot be initialized.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600154D RID: 5453 RVA: 0x00051A0C File Offset: 0x0004FC0C
|
||||
public static IsolatedStorageFile GetUserStoreForApplication()
|
||||
{
|
||||
IsolatedStorageScope isolatedStorageScope = IsolatedStorageScope.User | IsolatedStorageScope.Application;
|
||||
IsolatedStorageFile isolatedStorageFile = new IsolatedStorageFile(isolatedStorageScope);
|
||||
isolatedStorageFile.InitStore(isolatedStorageScope, null);
|
||||
isolatedStorageFile._fullEvidences = Assembly.GetCallingAssembly().UnprotectedGetEvidence();
|
||||
isolatedStorageFile.PostInit();
|
||||
return isolatedStorageFile;
|
||||
}
|
||||
|
||||
/// <summary>Obtains user-scoped isolated storage corresponding to the calling code's assembly identity.</summary>
|
||||
/// <returns>An <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> object corresponding to the isolated storage scope based on the calling code's assembly identity.</returns>
|
||||
/// <exception cref="T:System.Security.SecurityException">Sufficient isolated storage permissions have not been granted. </exception>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">An isolated storage location cannot be initialized.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600154E RID: 5454 RVA: 0x00051A44 File Offset: 0x0004FC44
|
||||
public static IsolatedStorageFile GetUserStoreForAssembly()
|
||||
{
|
||||
IsolatedStorageScope isolatedStorageScope = IsolatedStorageScope.User | IsolatedStorageScope.Assembly;
|
||||
IsolatedStorageFile isolatedStorageFile = new IsolatedStorageFile(isolatedStorageScope);
|
||||
Evidence evidence = Assembly.GetCallingAssembly().UnprotectedGetEvidence();
|
||||
isolatedStorageFile._fullEvidences = evidence;
|
||||
isolatedStorageFile._assemblyIdentity = IsolatedStorageFile.GetAssemblyIdentityFromEvidence(evidence);
|
||||
isolatedStorageFile.PostInit();
|
||||
return isolatedStorageFile;
|
||||
}
|
||||
|
||||
/// <summary>Obtains user-scoped isolated storage corresponding to the application domain identity and assembly identity.</summary>
|
||||
/// <returns>An <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> object corresponding to the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageScope" />, based on a combination of the application domain identity and the assembly identity.</returns>
|
||||
/// <exception cref="T:System.Security.SecurityException">Sufficient isolated storage permissions have not been granted. </exception>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">The store failed to open.-or- The assembly specified has insufficient permissions to create isolated stores. -or-An isolated storage location cannot be initialized.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600154F RID: 5455 RVA: 0x00051A80 File Offset: 0x0004FC80
|
||||
public static IsolatedStorageFile GetUserStoreForDomain()
|
||||
{
|
||||
IsolatedStorageScope isolatedStorageScope = IsolatedStorageScope.User | IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly;
|
||||
IsolatedStorageFile isolatedStorageFile = new IsolatedStorageFile(isolatedStorageScope);
|
||||
isolatedStorageFile._domainIdentity = IsolatedStorageFile.GetDomainIdentityFromEvidence(AppDomain.CurrentDomain.Evidence);
|
||||
Evidence evidence = Assembly.GetCallingAssembly().UnprotectedGetEvidence();
|
||||
isolatedStorageFile._fullEvidences = evidence;
|
||||
isolatedStorageFile._assemblyIdentity = IsolatedStorageFile.GetAssemblyIdentityFromEvidence(evidence);
|
||||
isolatedStorageFile.PostInit();
|
||||
return isolatedStorageFile;
|
||||
}
|
||||
|
||||
/// <summary>Removes the specified isolated storage scope for all identities.</summary>
|
||||
/// <param name="scope">A bitwise combination of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageScope" /> values. </param>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">The isolated store cannot be removed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001550 RID: 5456 RVA: 0x00051AD0 File Offset: 0x0004FCD0
|
||||
public static void Remove(IsolatedStorageScope scope)
|
||||
{
|
||||
string isolatedStorageRoot = IsolatedStorageFile.GetIsolatedStorageRoot(scope);
|
||||
Directory.Delete(isolatedStorageRoot, true);
|
||||
}
|
||||
|
||||
// Token: 0x06001551 RID: 5457 RVA: 0x00051AEC File Offset: 0x0004FCEC
|
||||
internal static string GetIsolatedStorageRoot(IsolatedStorageScope scope)
|
||||
{
|
||||
string text = null;
|
||||
if ((scope & IsolatedStorageScope.User) != IsolatedStorageScope.None)
|
||||
{
|
||||
if ((scope & IsolatedStorageScope.Roaming) != IsolatedStorageScope.None)
|
||||
{
|
||||
text = Environment.InternalGetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
||||
}
|
||||
else
|
||||
{
|
||||
text = Environment.InternalGetFolderPath(Environment.SpecialFolder.ApplicationData);
|
||||
}
|
||||
}
|
||||
else if ((scope & IsolatedStorageScope.Machine) != IsolatedStorageScope.None)
|
||||
{
|
||||
text = Environment.InternalGetFolderPath(Environment.SpecialFolder.CommonApplicationData);
|
||||
}
|
||||
if (text == null)
|
||||
{
|
||||
string text2 = Locale.GetText("Couldn't access storage location for '{0}'.");
|
||||
throw new IsolatedStorageException(string.Format(text2, scope));
|
||||
}
|
||||
return Path.Combine(text, ".isolated-storage");
|
||||
}
|
||||
|
||||
// Token: 0x06001552 RID: 5458 RVA: 0x00051B64 File Offset: 0x0004FD64
|
||||
private static void Demand(IsolatedStorageScope scope)
|
||||
{
|
||||
if (SecurityManager.SecurityEnabled)
|
||||
{
|
||||
new IsolatedStorageFilePermission(PermissionState.None)
|
||||
{
|
||||
UsageAllowed = IsolatedStorageFile.ScopeToContainment(scope)
|
||||
}.Demand();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001553 RID: 5459 RVA: 0x00051B94 File Offset: 0x0004FD94
|
||||
private static IsolatedStorageContainment ScopeToContainment(IsolatedStorageScope scope)
|
||||
{
|
||||
switch (scope)
|
||||
{
|
||||
case IsolatedStorageScope.User | IsolatedStorageScope.Assembly:
|
||||
return IsolatedStorageContainment.AssemblyIsolationByUser;
|
||||
default:
|
||||
switch (scope)
|
||||
{
|
||||
case IsolatedStorageScope.User | IsolatedStorageScope.Assembly | IsolatedStorageScope.Roaming:
|
||||
return IsolatedStorageContainment.AssemblyIsolationByRoamingUser;
|
||||
default:
|
||||
switch (scope)
|
||||
{
|
||||
case IsolatedStorageScope.Assembly | IsolatedStorageScope.Machine:
|
||||
return IsolatedStorageContainment.AssemblyIsolationByMachine;
|
||||
default:
|
||||
if (scope == (IsolatedStorageScope.User | IsolatedStorageScope.Application))
|
||||
{
|
||||
return IsolatedStorageContainment.ApplicationIsolationByUser;
|
||||
}
|
||||
if (scope == (IsolatedStorageScope.User | IsolatedStorageScope.Roaming | IsolatedStorageScope.Application))
|
||||
{
|
||||
return IsolatedStorageContainment.ApplicationIsolationByRoamingUser;
|
||||
}
|
||||
if (scope != (IsolatedStorageScope.Machine | IsolatedStorageScope.Application))
|
||||
{
|
||||
return IsolatedStorageContainment.UnrestrictedIsolatedStorage;
|
||||
}
|
||||
return IsolatedStorageContainment.ApplicationIsolationByMachine;
|
||||
case IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly | IsolatedStorageScope.Machine:
|
||||
return IsolatedStorageContainment.DomainIsolationByMachine;
|
||||
}
|
||||
break;
|
||||
case IsolatedStorageScope.User | IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly | IsolatedStorageScope.Roaming:
|
||||
return IsolatedStorageContainment.DomainIsolationByRoamingUser;
|
||||
}
|
||||
break;
|
||||
case IsolatedStorageScope.User | IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly:
|
||||
return IsolatedStorageContainment.DomainIsolationByUser;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001554 RID: 5460 RVA: 0x00051C20 File Offset: 0x0004FE20
|
||||
internal static ulong GetDirectorySize(DirectoryInfo di)
|
||||
{
|
||||
ulong num = 0UL;
|
||||
foreach (FileInfo fileInfo in di.GetFiles())
|
||||
{
|
||||
num += (ulong)fileInfo.Length;
|
||||
}
|
||||
foreach (DirectoryInfo directoryInfo in di.GetDirectories())
|
||||
{
|
||||
num += IsolatedStorageFile.GetDirectorySize(directoryInfo);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x06001555 RID: 5461 RVA: 0x00051C8C File Offset: 0x0004FE8C
|
||||
~IsolatedStorageFile()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06001556 RID: 5462 RVA: 0x00051CC4 File Offset: 0x0004FEC4
|
||||
private void PostInit()
|
||||
{
|
||||
string text = IsolatedStorageFile.GetIsolatedStorageRoot(base.Scope);
|
||||
string text2;
|
||||
if (this._applicationIdentity != null)
|
||||
{
|
||||
text2 = string.Format("a{0}{1}", this.SeparatorInternal, this.GetNameFromIdentity(this._applicationIdentity));
|
||||
}
|
||||
else if (this._domainIdentity != null)
|
||||
{
|
||||
text2 = string.Format("d{0}{1}{0}{2}", this.SeparatorInternal, this.GetNameFromIdentity(this._domainIdentity), this.GetNameFromIdentity(this._assemblyIdentity));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._assemblyIdentity == null)
|
||||
{
|
||||
throw new IsolatedStorageException(Locale.GetText("No code identity available."));
|
||||
}
|
||||
text2 = string.Format("d{0}none{0}{1}", this.SeparatorInternal, this.GetNameFromIdentity(this._assemblyIdentity));
|
||||
}
|
||||
text = Path.Combine(text, text2);
|
||||
this.directory = new DirectoryInfo(text);
|
||||
if (!this.directory.Exists)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.directory.Create();
|
||||
this.SaveIdentities(text);
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the current size of the isolated storage.</summary>
|
||||
/// <returns>The total number of bytes of storage currently in use within the isolated storage scope.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The property is unavailable. The current store has a roaming scope or is not open. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The current object size is undefined.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x170003CB RID: 971
|
||||
// (get) Token: 0x06001557 RID: 5463 RVA: 0x00051DF0 File Offset: 0x0004FFF0
|
||||
[CLSCompliant(false)]
|
||||
public override ulong CurrentSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return IsolatedStorageFile.GetDirectorySize(this.directory);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value representing the maximum amount of space available for isolated storage within the limits established by the quota.</summary>
|
||||
/// <returns>The limit of isolated storage space in bytes.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The property is unavailable. <see cref="P:System.IO.IsolatedStorage.IsolatedStorageFile.MaximumSize" /> cannot be determined without evidence from the assembly's creation. The evidence could not be determined when the object was created. </exception>
|
||||
// Token: 0x170003CC RID: 972
|
||||
// (get) Token: 0x06001558 RID: 5464 RVA: 0x00051E00 File Offset: 0x00050000
|
||||
[CLSCompliant(false)]
|
||||
public override ulong MaximumSize
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!SecurityManager.SecurityEnabled)
|
||||
{
|
||||
return 9223372036854775807UL;
|
||||
}
|
||||
if (this._resolved)
|
||||
{
|
||||
return this._maxSize;
|
||||
}
|
||||
Evidence evidence;
|
||||
if (this._fullEvidences != null)
|
||||
{
|
||||
evidence = this._fullEvidences;
|
||||
}
|
||||
else
|
||||
{
|
||||
evidence = new Evidence();
|
||||
if (this._assemblyIdentity != null)
|
||||
{
|
||||
evidence.AddHost(this._assemblyIdentity);
|
||||
}
|
||||
}
|
||||
if (evidence.Count < 1)
|
||||
{
|
||||
throw new InvalidOperationException(Locale.GetText("Couldn't get the quota from the available evidences."));
|
||||
}
|
||||
PermissionSet permissionSet = null;
|
||||
PermissionSet permissionSet2 = SecurityManager.ResolvePolicy(evidence, null, null, null, out permissionSet);
|
||||
IsolatedStoragePermission permission = this.GetPermission(permissionSet2);
|
||||
if (permission == null)
|
||||
{
|
||||
if (!permissionSet2.IsUnrestricted())
|
||||
{
|
||||
throw new InvalidOperationException(Locale.GetText("No quota from the available evidences."));
|
||||
}
|
||||
this._maxSize = 9223372036854775807UL;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._maxSize = (ulong)permission.UserQuota;
|
||||
}
|
||||
this._resolved = true;
|
||||
return this._maxSize;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170003CD RID: 973
|
||||
// (get) Token: 0x06001559 RID: 5465 RVA: 0x00051EF0 File Offset: 0x000500F0
|
||||
internal string Root
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.directory.FullName;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Closes a store previously opened with <see cref="M:System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(System.IO.IsolatedStorage.IsolatedStorageScope,System.Type,System.Type)" />, <see cref="M:System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForAssembly" />, or <see cref="M:System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForDomain" />.</summary>
|
||||
// Token: 0x0600155A RID: 5466 RVA: 0x00051F00 File Offset: 0x00050100
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Creates a directory in the isolated storage scope.</summary>
|
||||
/// <param name="dir">The relative path of the directory to create within the isolated storage scope. </param>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">The current code has insufficient permissions to create isolated storage directory. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The directory path is null. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600155B RID: 5467 RVA: 0x00051F04 File Offset: 0x00050104
|
||||
public void CreateDirectory(string dir)
|
||||
{
|
||||
if (dir == null)
|
||||
{
|
||||
throw new ArgumentNullException("dir");
|
||||
}
|
||||
if (dir.IndexOfAny(Path.PathSeparatorChars) < 0)
|
||||
{
|
||||
if (this.directory.GetFiles(dir).Length > 0)
|
||||
{
|
||||
throw new IOException(Locale.GetText("Directory name already exists as a file."));
|
||||
}
|
||||
this.directory.CreateSubdirectory(dir);
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] array = dir.Split(Path.PathSeparatorChars);
|
||||
DirectoryInfo directoryInfo = this.directory;
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
if (directoryInfo.GetFiles(array[i]).Length > 0)
|
||||
{
|
||||
throw new IOException(Locale.GetText("Part of the directory name already exists as a file."));
|
||||
}
|
||||
directoryInfo = directoryInfo.CreateSubdirectory(array[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Deletes a directory in the isolated storage scope.</summary>
|
||||
/// <param name="dir">The relative path of the directory to delete within the isolated storage scope. </param>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">The directory could not be deleted. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The directory path was null. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600155C RID: 5468 RVA: 0x00051FBC File Offset: 0x000501BC
|
||||
public void DeleteDirectory(string dir)
|
||||
{
|
||||
try
|
||||
{
|
||||
DirectoryInfo directoryInfo = this.directory.CreateSubdirectory(dir);
|
||||
directoryInfo.Delete();
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw new IsolatedStorageException(Locale.GetText("Could not delete directory '{0}'", new object[] { dir }));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Deletes a file in the isolated storage scope.</summary>
|
||||
/// <param name="file">The relative path of the file to delete within the isolated storage scope. </param>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">The target file is open or the path is incorrect. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The file path is null. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600155D RID: 5469 RVA: 0x00052020 File Offset: 0x00050220
|
||||
public void DeleteFile(string file)
|
||||
{
|
||||
File.Delete(Path.Combine(this.directory.FullName, file));
|
||||
}
|
||||
|
||||
/// <summary>Releases all resources used by the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" />. </summary>
|
||||
// Token: 0x0600155E RID: 5470 RVA: 0x00052038 File Offset: 0x00050238
|
||||
public void Dispose()
|
||||
{
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>Enumerates directories in an isolated storage scope that match a given pattern.</summary>
|
||||
/// <returns>An <see cref="T:System.Array" /> of the relative paths of directories in the isolated storage scope that match <paramref name="searchPattern" />. A zero-length array specifies that there are no directories that match.</returns>
|
||||
/// <param name="searchPattern">A search pattern. Both single-character ("?") and multi-character ("*") wildcards are supported. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="searchPattern" /> was null. </exception>
|
||||
/// <exception cref="T:System.UnauthorizedAccessException">The caller does not have permission to enumerate directories resolved from <paramref name="searchPattern" />.</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The isolated store has been disposed.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The isolated store is closed.</exception>
|
||||
/// <exception cref="T:System.IO.DirectoryNotFoundException">The directory or directories specified by <paramref name="searchPattern" /> are not found.</exception>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">The isolated store has been removed. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600155F RID: 5471 RVA: 0x00052040 File Offset: 0x00050240
|
||||
public string[] GetDirectoryNames(string searchPattern)
|
||||
{
|
||||
if (searchPattern == null)
|
||||
{
|
||||
throw new ArgumentNullException("searchPattern");
|
||||
}
|
||||
string directoryName = Path.GetDirectoryName(searchPattern);
|
||||
string fileName = Path.GetFileName(searchPattern);
|
||||
DirectoryInfo[] array;
|
||||
if (directoryName == null || directoryName.Length == 0)
|
||||
{
|
||||
array = this.directory.GetDirectories(searchPattern);
|
||||
}
|
||||
else
|
||||
{
|
||||
DirectoryInfo[] directories = this.directory.GetDirectories(directoryName);
|
||||
if (directories.Length != 1 || !(directories[0].Name == directoryName) || directories[0].FullName.IndexOf(this.directory.FullName) < 0)
|
||||
{
|
||||
throw new SecurityException();
|
||||
}
|
||||
array = directories[0].GetDirectories(fileName);
|
||||
}
|
||||
return this.GetNames(array);
|
||||
}
|
||||
|
||||
// Token: 0x06001560 RID: 5472 RVA: 0x000520F4 File Offset: 0x000502F4
|
||||
private string[] GetNames(FileSystemInfo[] afsi)
|
||||
{
|
||||
string[] array = new string[afsi.Length];
|
||||
for (int num = 0; num != afsi.Length; num++)
|
||||
{
|
||||
array[num] = afsi[num].Name;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
/// <summary>Enumerates files in isolated storage scope that match a given pattern.</summary>
|
||||
/// <returns>An <see cref="T:System.Array" /> of relative paths of files in the isolated storage scope that match <paramref name="searchPattern" />. A zero-length array specifies that there are no files that match.</returns>
|
||||
/// <param name="searchPattern">A search pattern. Both single-character ("?") and multi-character ("*") wildcards are supported. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="searchPattern" /> was null. </exception>
|
||||
/// <exception cref="T:System.IO.DirectoryNotFoundException">The file path specified by <paramref name="searchPattern" /> cannot be found.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001561 RID: 5473 RVA: 0x0005212C File Offset: 0x0005032C
|
||||
public string[] GetFileNames(string searchPattern)
|
||||
{
|
||||
if (searchPattern == null)
|
||||
{
|
||||
throw new ArgumentNullException("searchPattern");
|
||||
}
|
||||
string directoryName = Path.GetDirectoryName(searchPattern);
|
||||
string fileName = Path.GetFileName(searchPattern);
|
||||
FileInfo[] array;
|
||||
if (directoryName == null || directoryName.Length == 0)
|
||||
{
|
||||
array = this.directory.GetFiles(searchPattern);
|
||||
}
|
||||
else
|
||||
{
|
||||
DirectoryInfo[] directories = this.directory.GetDirectories(directoryName);
|
||||
if (directories.Length != 1 || !(directories[0].Name == directoryName) || directories[0].FullName.IndexOf(this.directory.FullName) < 0)
|
||||
{
|
||||
throw new SecurityException();
|
||||
}
|
||||
array = directories[0].GetFiles(fileName);
|
||||
}
|
||||
return this.GetNames(array);
|
||||
}
|
||||
|
||||
/// <summary>Removes the isolated storage scope and all its contents.</summary>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">The isolated store cannot be deleted. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001562 RID: 5474 RVA: 0x000521E0 File Offset: 0x000503E0
|
||||
public override void Remove()
|
||||
{
|
||||
this.directory.Delete(true);
|
||||
}
|
||||
|
||||
// Token: 0x06001563 RID: 5475 RVA: 0x000521F0 File Offset: 0x000503F0
|
||||
protected override IsolatedStoragePermission GetPermission(PermissionSet ps)
|
||||
{
|
||||
if (ps == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return (IsolatedStoragePermission)ps.GetPermission(typeof(IsolatedStorageFilePermission));
|
||||
}
|
||||
|
||||
// Token: 0x06001564 RID: 5476 RVA: 0x00052210 File Offset: 0x00050410
|
||||
private string GetNameFromIdentity(object identity)
|
||||
{
|
||||
byte[] bytes = Encoding.UTF8.GetBytes(identity.ToString());
|
||||
SHA1 sha = SHA1.Create();
|
||||
byte[] array = sha.ComputeHash(bytes, 0, bytes.Length);
|
||||
byte[] array2 = new byte[10];
|
||||
Buffer.BlockCopy(array, 0, array2, 0, array2.Length);
|
||||
return CryptoConvert.ToHex(array2);
|
||||
}
|
||||
|
||||
// Token: 0x06001565 RID: 5477 RVA: 0x0005225C File Offset: 0x0005045C
|
||||
private static object GetTypeFromEvidence(Evidence e, Type t)
|
||||
{
|
||||
foreach (object obj in e)
|
||||
{
|
||||
if (obj.GetType() == t)
|
||||
{
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Token: 0x06001566 RID: 5478 RVA: 0x000522D0 File Offset: 0x000504D0
|
||||
internal static object GetAssemblyIdentityFromEvidence(Evidence e)
|
||||
{
|
||||
object obj = IsolatedStorageFile.GetTypeFromEvidence(e, typeof(Publisher));
|
||||
if (obj != null)
|
||||
{
|
||||
return obj;
|
||||
}
|
||||
obj = IsolatedStorageFile.GetTypeFromEvidence(e, typeof(StrongName));
|
||||
if (obj != null)
|
||||
{
|
||||
return obj;
|
||||
}
|
||||
return IsolatedStorageFile.GetTypeFromEvidence(e, typeof(Url));
|
||||
}
|
||||
|
||||
// Token: 0x06001567 RID: 5479 RVA: 0x00052320 File Offset: 0x00050520
|
||||
internal static object GetDomainIdentityFromEvidence(Evidence e)
|
||||
{
|
||||
object typeFromEvidence = IsolatedStorageFile.GetTypeFromEvidence(e, typeof(ApplicationDirectory));
|
||||
if (typeFromEvidence != null)
|
||||
{
|
||||
return typeFromEvidence;
|
||||
}
|
||||
return IsolatedStorageFile.GetTypeFromEvidence(e, typeof(Url));
|
||||
}
|
||||
|
||||
// Token: 0x06001568 RID: 5480 RVA: 0x00052358 File Offset: 0x00050558
|
||||
private void SaveIdentities(string root)
|
||||
{
|
||||
IsolatedStorageFile.Identities identities = new IsolatedStorageFile.Identities(this._applicationIdentity, this._assemblyIdentity, this._domainIdentity);
|
||||
BinaryFormatter binaryFormatter = new BinaryFormatter();
|
||||
IsolatedStorageFile.mutex.WaitOne();
|
||||
try
|
||||
{
|
||||
using (FileStream fileStream = File.Create(root + ".storage"))
|
||||
{
|
||||
binaryFormatter.Serialize(fileStream, identities);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
IsolatedStorageFile.mutex.ReleaseMutex();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000621 RID: 1569
|
||||
private bool _resolved;
|
||||
|
||||
// Token: 0x04000622 RID: 1570
|
||||
private ulong _maxSize;
|
||||
|
||||
// Token: 0x04000623 RID: 1571
|
||||
private Evidence _fullEvidences;
|
||||
|
||||
// Token: 0x04000624 RID: 1572
|
||||
private static Mutex mutex = new Mutex();
|
||||
|
||||
// Token: 0x04000625 RID: 1573
|
||||
private DirectoryInfo directory;
|
||||
|
||||
// Token: 0x020001A3 RID: 419
|
||||
[Serializable]
|
||||
private struct Identities
|
||||
{
|
||||
// Token: 0x06001569 RID: 5481 RVA: 0x00052404 File Offset: 0x00050604
|
||||
public Identities(object application, object assembly, object domain)
|
||||
{
|
||||
this.Application = application;
|
||||
this.Assembly = assembly;
|
||||
this.Domain = domain;
|
||||
}
|
||||
|
||||
// Token: 0x04000626 RID: 1574
|
||||
public object Application;
|
||||
|
||||
// Token: 0x04000627 RID: 1575
|
||||
public object Assembly;
|
||||
|
||||
// Token: 0x04000628 RID: 1576
|
||||
public object Domain;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.IO.IsolatedStorage
|
||||
{
|
||||
// Token: 0x020001A4 RID: 420
|
||||
internal class IsolatedStorageFileEnumerator : IEnumerator
|
||||
{
|
||||
// Token: 0x0600156A RID: 5482 RVA: 0x0005241C File Offset: 0x0005061C
|
||||
public IsolatedStorageFileEnumerator(IsolatedStorageScope scope, string root)
|
||||
{
|
||||
this._scope = scope;
|
||||
if (Directory.Exists(root))
|
||||
{
|
||||
this._storages = Directory.GetDirectories(root, "d.*");
|
||||
}
|
||||
this._pos = -1;
|
||||
}
|
||||
|
||||
// Token: 0x170003CE RID: 974
|
||||
// (get) Token: 0x0600156B RID: 5483 RVA: 0x0005245C File Offset: 0x0005065C
|
||||
public object Current
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._pos < 0 || this._storages == null || this._pos >= this._storages.Length)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return new IsolatedStorageFile(this._scope, this._storages[this._pos]);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600156C RID: 5484 RVA: 0x000524B0 File Offset: 0x000506B0
|
||||
public bool MoveNext()
|
||||
{
|
||||
return this._storages != null && ++this._pos < this._storages.Length;
|
||||
}
|
||||
|
||||
// Token: 0x0600156D RID: 5485 RVA: 0x000524E8 File Offset: 0x000506E8
|
||||
public void Reset()
|
||||
{
|
||||
this._pos = -1;
|
||||
}
|
||||
|
||||
// Token: 0x04000629 RID: 1577
|
||||
private IsolatedStorageScope _scope;
|
||||
|
||||
// Token: 0x0400062A RID: 1578
|
||||
private string[] _storages;
|
||||
|
||||
// Token: 0x0400062B RID: 1579
|
||||
private int _pos;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,425 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
|
||||
namespace System.IO.IsolatedStorage
|
||||
{
|
||||
/// <summary>Exposes a file within isolated storage.</summary>
|
||||
// Token: 0x020001A5 RID: 421
|
||||
[ComVisible(true)]
|
||||
public class IsolatedStorageFileStream : FileStream
|
||||
{
|
||||
/// <summary>Initializes a new instance of an <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object giving access to the file designated by <paramref name="path" /> in the specified <paramref name="mode" />.</summary>
|
||||
/// <param name="path">The relative path of the file within isolated storage. </param>
|
||||
/// <param name="mode">One of the <see cref="T:System.IO.FileMode" /> values. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="path" /> is badly formed. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="path" /> is null. </exception>
|
||||
/// <exception cref="T:System.IO.DirectoryNotFoundException">The directory in <paramref name="path" /> does not exist. </exception>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">No file was found and the <paramref name="mode" /> is set to <see cref="F:System.IO.FileMode.Open" /></exception>
|
||||
// Token: 0x0600156E RID: 5486 RVA: 0x000524F4 File Offset: 0x000506F4
|
||||
public IsolatedStorageFileStream(string path, FileMode mode)
|
||||
: this(path, mode, (mode != FileMode.Append) ? FileAccess.ReadWrite : FileAccess.Write, FileShare.Read, 8192, null)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> class giving access to the file designated by <paramref name="path" />, in the specified <paramref name="mode" />, with the kind of <paramref name="access" /> requested.</summary>
|
||||
/// <param name="path">The relative path of the file within isolated storage. </param>
|
||||
/// <param name="mode">One of the <see cref="T:System.IO.FileMode" /> values. </param>
|
||||
/// <param name="access">A bitwise combination of the <see cref="T:System.IO.FileAccess" /> values. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="path" /> is badly formed. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="path" /> is null. </exception>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">No file was found and the <paramref name="mode" /> is set to <see cref="F:System.IO.FileMode.Open" />. </exception>
|
||||
// Token: 0x0600156F RID: 5487 RVA: 0x00052520 File Offset: 0x00050720
|
||||
public IsolatedStorageFileStream(string path, FileMode mode, FileAccess access)
|
||||
: this(path, mode, access, (access != FileAccess.Write) ? FileShare.Read : FileShare.None, 8192, null)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> class giving access to the file designated by <paramref name="path" />, in the specified <paramref name="mode" />, with the specified file <paramref name="access" />, using the file sharing mode specified by <paramref name="share" />.</summary>
|
||||
/// <param name="path">The relative path of the file within isolated storage. </param>
|
||||
/// <param name="mode">One of the <see cref="T:System.IO.FileMode" /> values. </param>
|
||||
/// <param name="access">A bitwise combination of the <see cref="T:System.IO.FileAccess" /> values. </param>
|
||||
/// <param name="share">A bitwise combination of the <see cref="T:System.IO.FileShare" /> values. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="path" /> is badly formed. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="path" /> is null. </exception>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">No file was found and the <paramref name="mode" /> is set to <see cref="F:System.IO.FileMode.Open" />. </exception>
|
||||
// Token: 0x06001570 RID: 5488 RVA: 0x0005254C File Offset: 0x0005074C
|
||||
public IsolatedStorageFileStream(string path, FileMode mode, FileAccess access, FileShare share)
|
||||
: this(path, mode, access, share, 8192, null)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> class giving access to the file designated by <paramref name="path" />, in the specified <paramref name="mode" />, with the specified file <paramref name="access" />, using the file sharing mode specified by <paramref name="share" />, with the <paramref name="buffersize" /> specified.</summary>
|
||||
/// <param name="path">The relative path of the file within isolated storage. </param>
|
||||
/// <param name="mode">One of the <see cref="T:System.IO.FileMode" /> values. </param>
|
||||
/// <param name="access">A bitwise combination of the <see cref="T:System.IO.FileAccess" /> values. </param>
|
||||
/// <param name="share">A bitwise combination of the <see cref="T:System.IO.FileShare" /> values. </param>
|
||||
/// <param name="bufferSize">The <see cref="T:System.IO.FileStream" /> buffer size. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="path" /> is badly formed. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="path" /> is null. </exception>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">No file was found and the <paramref name="mode" /> is set to <see cref="F:System.IO.FileMode.Open" />. </exception>
|
||||
// Token: 0x06001571 RID: 5489 RVA: 0x00052560 File Offset: 0x00050760
|
||||
public IsolatedStorageFileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize)
|
||||
: this(path, mode, access, share, bufferSize, null)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> class giving access to the file designated by <paramref name="path" />, in the specified <paramref name="mode" />, with the specified file <paramref name="access" />, using the file sharing mode specified by <paramref name="share" />, with the <paramref name="buffersize" /> specified, and in the context of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> specified by <paramref name="isf" />.</summary>
|
||||
/// <param name="path">The relative path of the file within isolated storage. </param>
|
||||
/// <param name="mode">One of the <see cref="T:System.IO.FileMode" /> values. </param>
|
||||
/// <param name="access">A bitwise combination of the <see cref="T:System.IO.FileAccess" /> values. </param>
|
||||
/// <param name="share">A bitwise combination of the <see cref="T:System.IO.FileShare" /> values </param>
|
||||
/// <param name="bufferSize">The <see cref="T:System.IO.FileStream" /> buffer size. </param>
|
||||
/// <param name="isf">The <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> in which to open the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" />. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="path" /> is badly formed. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="path" /> is null. </exception>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">No file was found and the <paramref name="mode" /> is set to <see cref="F:System.IO.FileMode.Open" />. </exception>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">
|
||||
/// <paramref name="isf" /> does not have a quota. </exception>
|
||||
// Token: 0x06001572 RID: 5490 RVA: 0x00052570 File Offset: 0x00050770
|
||||
public IsolatedStorageFileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, IsolatedStorageFile isf)
|
||||
: base(IsolatedStorageFileStream.CreateIsolatedPath(isf, path, mode), mode, access, share, bufferSize, false, true)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> class giving access to the file designated by <paramref name="path" />, in the specified <paramref name="mode" />, with the specified file <paramref name="access" />, using the file sharing mode specified by <paramref name="share" />, and in the context of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> specified by <paramref name="isf" />.</summary>
|
||||
/// <param name="path">The relative path of the file within isolated storage. </param>
|
||||
/// <param name="mode">One of the <see cref="T:System.IO.FileMode" /> values. </param>
|
||||
/// <param name="access">A bitwise combination of the <see cref="T:System.IO.FileAccess" /> values. </param>
|
||||
/// <param name="share">A bitwise combination of the <see cref="T:System.IO.FileShare" /> values. </param>
|
||||
/// <param name="isf">The <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> in which to open the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" />. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="path" /> is badly formed. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="path" /> is null. </exception>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">No file was found and the <paramref name="mode" /> is set to <see cref="F:System.IO.FileMode.Open" />. </exception>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">
|
||||
/// <paramref name="isf" /> does not have a quota. </exception>
|
||||
// Token: 0x06001573 RID: 5491 RVA: 0x00052594 File Offset: 0x00050794
|
||||
public IsolatedStorageFileStream(string path, FileMode mode, FileAccess access, FileShare share, IsolatedStorageFile isf)
|
||||
: this(path, mode, access, share, 8192, isf)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> class giving access to the file designated by <paramref name="path" /> in the specified <paramref name="mode" />, with the specified file <paramref name="access" />, and in the context of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> specified by <paramref name="isf" />.</summary>
|
||||
/// <param name="path">The relative path of the file within isolated storage. </param>
|
||||
/// <param name="mode">One of the <see cref="T:System.IO.FileMode" /> values. </param>
|
||||
/// <param name="access">A bitwise combination of the <see cref="T:System.IO.FileAccess" /> values. </param>
|
||||
/// <param name="isf">The <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> in which to open the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" />. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="path" /> is badly formed. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="path" /> is null. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The isolated store is closed.</exception>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">No file was found and the <paramref name="mode" /> is set to <see cref="F:System.IO.FileMode.Open" />. </exception>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">
|
||||
/// <paramref name="isf" /> does not have a quota. </exception>
|
||||
// Token: 0x06001574 RID: 5492 RVA: 0x000525A8 File Offset: 0x000507A8
|
||||
public IsolatedStorageFileStream(string path, FileMode mode, FileAccess access, IsolatedStorageFile isf)
|
||||
: this(path, mode, access, (access != FileAccess.Write) ? FileShare.Read : FileShare.None, 8192, isf)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> class giving access to the file designated by <paramref name="path" />, in the specified <paramref name="mode" />, and in the context of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> specified by <paramref name="isf" />.</summary>
|
||||
/// <param name="path">The relative path of the file within isolated storage. </param>
|
||||
/// <param name="mode">One of the <see cref="T:System.IO.FileMode" /> values. </param>
|
||||
/// <param name="isf">The <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFile" /> in which to open the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" />. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="path" /> is badly formed. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="path" /> is null. </exception>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">No file was found and the <paramref name="mode" /> is set to <see cref="F:System.IO.FileMode.Open" />. </exception>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">
|
||||
/// <paramref name="isf" /> does not have a quota. </exception>
|
||||
// Token: 0x06001575 RID: 5493 RVA: 0x000525D4 File Offset: 0x000507D4
|
||||
public IsolatedStorageFileStream(string path, FileMode mode, IsolatedStorageFile isf)
|
||||
: this(path, mode, (mode != FileMode.Append) ? FileAccess.ReadWrite : FileAccess.Write, FileShare.Read, 8192, isf)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06001576 RID: 5494 RVA: 0x00052600 File Offset: 0x00050800
|
||||
private static string CreateIsolatedPath(IsolatedStorageFile isf, string path, FileMode mode)
|
||||
{
|
||||
if (path == null)
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
}
|
||||
if (!Enum.IsDefined(typeof(FileMode), mode))
|
||||
{
|
||||
throw new ArgumentException("mode");
|
||||
}
|
||||
if (isf == null)
|
||||
{
|
||||
StackFrame stackFrame = new StackFrame(3);
|
||||
isf = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly, IsolatedStorageFile.GetDomainIdentityFromEvidence(AppDomain.CurrentDomain.Evidence), IsolatedStorageFile.GetAssemblyIdentityFromEvidence(stackFrame.GetMethod().ReflectedType.Assembly.UnprotectedGetEvidence()));
|
||||
}
|
||||
FileInfo fileInfo = new FileInfo(isf.Root);
|
||||
if (!fileInfo.Directory.Exists)
|
||||
{
|
||||
fileInfo.Directory.Create();
|
||||
}
|
||||
if (Path.IsPathRooted(path))
|
||||
{
|
||||
string pathRoot = Path.GetPathRoot(path);
|
||||
path = path.Remove(0, pathRoot.Length);
|
||||
}
|
||||
string text = Path.Combine(isf.Root, path);
|
||||
string text2 = Path.GetFullPath(text);
|
||||
text2 = Path.GetFullPath(text);
|
||||
if (!text2.StartsWith(isf.Root))
|
||||
{
|
||||
throw new IsolatedStorageException();
|
||||
}
|
||||
fileInfo = new FileInfo(text);
|
||||
if (!fileInfo.Directory.Exists)
|
||||
{
|
||||
string text3 = Locale.GetText("Could not find a part of the path \"{0}\".");
|
||||
throw new DirectoryNotFoundException(string.Format(text3, path));
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
/// <summary>Gets a Boolean value indicating whether the file can be read.</summary>
|
||||
/// <returns>true if an <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object can be read; otherwise, false.</returns>
|
||||
// Token: 0x170003CF RID: 975
|
||||
// (get) Token: 0x06001577 RID: 5495 RVA: 0x00052730 File Offset: 0x00050930
|
||||
public override bool CanRead
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.CanRead;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a Boolean value indicating whether seek operations are supported.</summary>
|
||||
/// <returns>true if an <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object supports seek operations; otherwise, false.</returns>
|
||||
// Token: 0x170003D0 RID: 976
|
||||
// (get) Token: 0x06001578 RID: 5496 RVA: 0x00052738 File Offset: 0x00050938
|
||||
public override bool CanSeek
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.CanSeek;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a Boolean value indicating whether you can write to the file.</summary>
|
||||
/// <returns>true if an <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object can be written; otherwise, false.</returns>
|
||||
// Token: 0x170003D1 RID: 977
|
||||
// (get) Token: 0x06001579 RID: 5497 RVA: 0x00052740 File Offset: 0x00050940
|
||||
public override bool CanWrite
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.CanWrite;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a <see cref="T:Microsoft.Win32.SafeHandles.SafeFileHandle" /> object that represents the operating system file handle for the file that the current <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object encapsulates.</summary>
|
||||
/// <returns>A <see cref="T:Microsoft.Win32.SafeHandles.SafeFileHandle" /> object that represents the operating system file handle for the file that the current <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object encapsulates.</returns>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">The <see cref="P:System.IO.IsolatedStorage.IsolatedStorageFileStream.SafeFileHandle" /> property always generates this exception. </exception>
|
||||
/// <exception cref="F:System.Security.Permissions.SecurityAction.LinkDemand">for full trust for the immediate caller. This member cannot be used by partially trusted code.</exception>
|
||||
/// <exception cref="F:System.Security.Permissions.SecurityAction.InheritanceDemand">for full trust for inheritors. This class cannot be inherited by partially trusted code. Associated enumeration: <see cref="F:System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode" /></exception>
|
||||
// Token: 0x170003D2 RID: 978
|
||||
// (get) Token: 0x0600157A RID: 5498 RVA: 0x00052748 File Offset: 0x00050948
|
||||
public override SafeFileHandle SafeFileHandle
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new IsolatedStorageException(Locale.GetText("Information is restricted"));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the file handle for the file that the current <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object encapsulates. Accessing this property is not permitted on an <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object, and throws an <see cref="T:System.IO.IsolatedStorage.IsolatedStorageException" />.</summary>
|
||||
/// <returns>The file handle for the file that the current <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object encapsulates.</returns>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">The <see cref="P:System.IO.IsolatedStorage.IsolatedStorageFileStream.Handle" /> property always generates this exception.</exception>
|
||||
/// <exception cref="F:System.Security.Permissions.SecurityAction.LinkDemand">for full trust for the immediate caller. This member cannot be used by partially trusted code.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x170003D3 RID: 979
|
||||
// (get) Token: 0x0600157B RID: 5499 RVA: 0x0005275C File Offset: 0x0005095C
|
||||
[Obsolete("Use SafeFileHandle - once available")]
|
||||
public override IntPtr Handle
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new IsolatedStorageException(Locale.GetText("Information is restricted"));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a Boolean value indicating whether the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object was opened asynchronously or synchronously.</summary>
|
||||
/// <returns>true if the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object supports asynchronous access; otherwise, false.</returns>
|
||||
// Token: 0x170003D4 RID: 980
|
||||
// (get) Token: 0x0600157C RID: 5500 RVA: 0x00052770 File Offset: 0x00050970
|
||||
public override bool IsAsync
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.IsAsync;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the length of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object.</summary>
|
||||
/// <returns>The length of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object in bytes.</returns>
|
||||
// Token: 0x170003D5 RID: 981
|
||||
// (get) Token: 0x0600157D RID: 5501 RVA: 0x00052778 File Offset: 0x00050978
|
||||
public override long Length
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Length;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the current position of the current <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object.</summary>
|
||||
/// <returns>The current position of this <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object.</returns>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The position cannot be set to a negative number. </exception>
|
||||
// Token: 0x170003D6 RID: 982
|
||||
// (get) Token: 0x0600157E RID: 5502 RVA: 0x00052780 File Offset: 0x00050980
|
||||
// (set) Token: 0x0600157F RID: 5503 RVA: 0x00052788 File Offset: 0x00050988
|
||||
public override long Position
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Position;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Position = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous read.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> object that represents the asynchronous read, which is possibly still pending. This <see cref="T:System.IAsyncResult" /> must be passed to this stream's <see cref="M:System.IO.IsolatedStorage.IsolatedStorageFileStream.EndRead(System.IAsyncResult)" /> method to determine how many bytes were read. This can be done either by the same code that called <see cref="M:System.IO.IsolatedStorage.IsolatedStorageFileStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> or in a callback passed to <see cref="M:System.IO.IsolatedStorage.IsolatedStorageFileStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" />.</returns>
|
||||
/// <param name="buffer">The buffer to read data into. </param>
|
||||
/// <param name="offset">The byte offset in <paramref name="buffer" /> at which to begin reading. </param>
|
||||
/// <param name="numBytes">The maximum number of bytes to read. </param>
|
||||
/// <param name="userCallback">The method to call when the asynchronous read operation is completed. This parameter is optional. </param>
|
||||
/// <param name="stateObject">The status of the asynchronous read. </param>
|
||||
/// <exception cref="T:System.IO.IOException">An asynchronous read was attempted past the end of the file. </exception>
|
||||
// Token: 0x06001580 RID: 5504 RVA: 0x00052794 File Offset: 0x00050994
|
||||
public override IAsyncResult BeginRead(byte[] buffer, int offset, int numBytes, AsyncCallback userCallback, object stateObject)
|
||||
{
|
||||
return base.BeginRead(buffer, offset, numBytes, userCallback, stateObject);
|
||||
}
|
||||
|
||||
/// <summary>Begins an asynchronous write.</summary>
|
||||
/// <returns>An <see cref="T:System.IAsyncResult" /> that represents the asynchronous write, which is possibly still pending. This <see cref="T:System.IAsyncResult" /> must be passed to this stream's <see cref="M:System.IO.Stream.EndWrite(System.IAsyncResult)" /> method to ensure that the write is complete, then frees resources appropriately. This can be done either by the same code that called <see cref="M:System.IO.Stream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> or in a callback passed to <see cref="M:System.IO.Stream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" />.</returns>
|
||||
/// <param name="buffer">The buffer to write data to. </param>
|
||||
/// <param name="offset">The byte offset in <paramref name="buffer" /> at which to begin writing. </param>
|
||||
/// <param name="numBytes">The maximum number of bytes to write. </param>
|
||||
/// <param name="userCallback">The method to call when the asynchronous write operation is completed. This parameter is optional. </param>
|
||||
/// <param name="stateObject">The status of the asynchronous write. </param>
|
||||
/// <exception cref="T:System.IO.IOException">An asynchronous write was attempted past the end of the file. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001581 RID: 5505 RVA: 0x000527A4 File Offset: 0x000509A4
|
||||
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int numBytes, AsyncCallback userCallback, object stateObject)
|
||||
{
|
||||
return base.BeginWrite(buffer, offset, numBytes, userCallback, stateObject);
|
||||
}
|
||||
|
||||
/// <summary>Ends a pending asynchronous read request.</summary>
|
||||
/// <returns>The number of bytes read from the stream, between zero and the number of requested bytes. Streams will only return zero at the end of the stream. Otherwise, they will block until at least one byte is available.</returns>
|
||||
/// <param name="asyncResult">The pending asynchronous request. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="asyncResult" /> is null. </exception>
|
||||
// Token: 0x06001582 RID: 5506 RVA: 0x000527B4 File Offset: 0x000509B4
|
||||
public override int EndRead(IAsyncResult asyncResult)
|
||||
{
|
||||
return base.EndRead(asyncResult);
|
||||
}
|
||||
|
||||
/// <summary>Ends an asynchronous write.</summary>
|
||||
/// <param name="asyncResult">The pending asynchronous I/O request to end. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="asyncResult" /> parameter is null. </exception>
|
||||
// Token: 0x06001583 RID: 5507 RVA: 0x000527C0 File Offset: 0x000509C0
|
||||
public override void EndWrite(IAsyncResult asyncResult)
|
||||
{
|
||||
base.EndWrite(asyncResult);
|
||||
}
|
||||
|
||||
/// <summary>Updates the file with the current state of the buffer then clears the buffer.</summary>
|
||||
// Token: 0x06001584 RID: 5508 RVA: 0x000527CC File Offset: 0x000509CC
|
||||
public override void Flush()
|
||||
{
|
||||
base.Flush();
|
||||
}
|
||||
|
||||
/// <summary>Copies bytes from the current buffered <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object to an array.</summary>
|
||||
/// <returns>The total number of bytes read into the <paramref name="buffer" />. This can be less than the number of bytes requested if that many bytes are not currently available, or zero if the end of the stream is reached.</returns>
|
||||
/// <param name="buffer">The buffer to read. </param>
|
||||
/// <param name="offset">The offset in the buffer at which to begin writing. </param>
|
||||
/// <param name="count">The maximum number of bytes to read. </param>
|
||||
// Token: 0x06001585 RID: 5509 RVA: 0x000527D4 File Offset: 0x000509D4
|
||||
public override int Read(byte[] buffer, int offset, int count)
|
||||
{
|
||||
return base.Read(buffer, offset, count);
|
||||
}
|
||||
|
||||
/// <summary>Reads a single byte from the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object in isolated storage.</summary>
|
||||
/// <returns>The 8-bit unsigned integer value read from the isolated storage file.</returns>
|
||||
// Token: 0x06001586 RID: 5510 RVA: 0x000527E0 File Offset: 0x000509E0
|
||||
public override int ReadByte()
|
||||
{
|
||||
return base.ReadByte();
|
||||
}
|
||||
|
||||
/// <summary>Sets the current position of this <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object to the specified value.</summary>
|
||||
/// <returns>The new position in the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object.</returns>
|
||||
/// <param name="offset">The new position of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object. </param>
|
||||
/// <param name="origin">One of the <see cref="T:System.IO.SeekOrigin" /> values. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="origin" /> must be one of the <see cref="T:System.IO.SeekOrigin" /> values. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001587 RID: 5511 RVA: 0x000527E8 File Offset: 0x000509E8
|
||||
public override long Seek(long offset, SeekOrigin origin)
|
||||
{
|
||||
return base.Seek(offset, origin);
|
||||
}
|
||||
|
||||
/// <summary>Sets the length of this <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object to the specified <paramref name="value" />.</summary>
|
||||
/// <param name="value">The new length of the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="value" /> is a negative number.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001588 RID: 5512 RVA: 0x000527F4 File Offset: 0x000509F4
|
||||
public override void SetLength(long value)
|
||||
{
|
||||
base.SetLength(value);
|
||||
}
|
||||
|
||||
/// <summary>Writes a block of bytes to the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object using data read from a byte array.</summary>
|
||||
/// <param name="buffer">The buffer to write. </param>
|
||||
/// <param name="offset">The byte offset in buffer from which to begin. </param>
|
||||
/// <param name="count">The maximum number of bytes to write. </param>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">The write attempt exceeds the quota for the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001589 RID: 5513 RVA: 0x00052800 File Offset: 0x00050A00
|
||||
public override void Write(byte[] buffer, int offset, int count)
|
||||
{
|
||||
base.Write(buffer, offset, count);
|
||||
}
|
||||
|
||||
/// <summary>Writes a single byte to the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object.</summary>
|
||||
/// <param name="value">The byte value to write to the isolated storage file. </param>
|
||||
/// <exception cref="T:System.IO.IsolatedStorage.IsolatedStorageException">The write attempt exceeds the quota for the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> object. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600158A RID: 5514 RVA: 0x0005280C File Offset: 0x00050A0C
|
||||
public override void WriteByte(byte value)
|
||||
{
|
||||
base.WriteByte(value);
|
||||
}
|
||||
|
||||
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.IO.IsolatedStorage.IsolatedStorageFileStream" /> and optionally releases the managed resources.</summary>
|
||||
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources </param>
|
||||
// Token: 0x0600158B RID: 5515 RVA: 0x00052818 File Offset: 0x00050A18
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.IO.IsolatedStorage
|
||||
{
|
||||
/// <summary>Enumerates the levels of isolated storage scope that are supported by <see cref="T:System.IO.IsolatedStorage.IsolatedStorage" />.</summary>
|
||||
// Token: 0x020001A6 RID: 422
|
||||
[ComVisible(true)]
|
||||
[Flags]
|
||||
[Serializable]
|
||||
public enum IsolatedStorageScope
|
||||
{
|
||||
/// <summary>No isolated storage usage.</summary>
|
||||
// Token: 0x0400062D RID: 1581
|
||||
None = 0,
|
||||
/// <summary>Isolated storage scoped by user identity.</summary>
|
||||
// Token: 0x0400062E RID: 1582
|
||||
User = 1,
|
||||
/// <summary>Isolated storage scoped to the application domain identity.</summary>
|
||||
// Token: 0x0400062F RID: 1583
|
||||
Domain = 2,
|
||||
/// <summary>Isolated storage scoped to the identity of the assembly.</summary>
|
||||
// Token: 0x04000630 RID: 1584
|
||||
Assembly = 4,
|
||||
/// <summary>The isolated store can be placed in a location on the file system that might roam (if roaming user data is enabled on the underlying operating system).</summary>
|
||||
// Token: 0x04000631 RID: 1585
|
||||
Roaming = 8,
|
||||
/// <summary>Isolated storage scoped to the machine.</summary>
|
||||
// Token: 0x04000632 RID: 1586
|
||||
Machine = 16,
|
||||
/// <summary>Isolated storage scoped to the application.</summary>
|
||||
// Token: 0x04000633 RID: 1587
|
||||
Application = 32
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user