System.IO.IsolatedStorage.IsolatedStorage Class

Assembly: Mscorlib.dll
Namespace: System.IO.IsolatedStorage
Summary
Represents the abstract base class from which all isolated storage implementations must derive.
C# Syntax:
public abstract class IsolatedStorage : MarshalByRefObject
Remarks
For information about file-based isolated storage, see the IsolatedStorageFile class.
See also:
System.IO.IsolatedStorage Namespace See also:
MSDN: isolatedstorage

System.IO.IsolatedStorage.IsolatedStorage Member List:

Public Properties
AssemblyIdentity Read-only

Gets an assembly identity used to scope isolated storage.
CurrentSize Read-only

Gets a value representing the current size of isolated storage.
DomainIdentity Read-only

Gets a domain identity that scopes isolated storage.
MaximumSize Read-only

Gets a value representing the maximum amount of space available for isolated storage. When overridden in a derived class, this value can take on different units of measure.
Scope Read-only

Gets an IsolatedStorageScope enumeration value specifying the scope used to isolate the store.
Public Methods
CreateObjRef
(inherited from System.MarshalByRefObject)
See base class member description: System.MarshalByRefObject.CreateObjRef


Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetLifetimeService
(inherited from System.MarshalByRefObject)
See base class member description: System.MarshalByRefObject.GetLifetimeService


Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
InitializeLifetimeService
(inherited from System.MarshalByRefObject)
See base class member description: System.MarshalByRefObject.InitializeLifetimeService


Obtains a lifetime service object to control the lifetime policy for this instance.
Remove When overridden in a derived class, removes the individual isolated store and all contained data.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
Protected Constructors
ctor #1 Default constructor. This constructor is called by derived class constructors to initialize state in this type.
Protected Properties
SeparatorExternal Read-only

Gets a backslash character that can be used in a directory string. When overridden in a derived class, another character might be returned.
SeparatorInternal Read-only

Gets a period character that can be used in a directory string. When overridden in a derived class, another character might be returned.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
GetPermission When implemented by a derived class, returns a permission that represents access to isolated storage from within a permission set.
InitStore Initializes a new instance of the IsolatedStorage object.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.IO.IsolatedStorage.IsolatedStorage Member Details

ctor #1
Summary:
Default constructor. This constructor is called by derived class constructors to initialize state in this type.
C# Syntax:
protected IsolatedStorage();

Return to top


Property: AssemblyIdentity (read-only)
Summary
Gets an assembly identity used to scope isolated storage.
C# Syntax:
public object AssemblyIdentity {get;}
Exceptions
Exception Type Condition
SecurityException The code lacks the required SecurityPermission to access this object.
.NET Framework Security:
SecurityPermission for the ability to access evidence. Associated enumeration: SecurityPermissionFlag.ControlPolicy

Return to top


Property: CurrentSize (read-only)
Summary
Gets a value representing the current size of isolated storage.
This member is not CLS Compliant

C# Syntax:
[CLSCompliant(false)]
public virtual ulong CurrentSize {get;}
Exceptions
Exception Type Condition
InvalidOperationException The current size of the isolated store is undefined.
Remarks
Represents the total usage of all storage resources within the isolated storage scope. IsolatedStorageFile.CurrentSize implements this property. In the case of IsolatedStorageFile objects this value is in bytes. In the case of implementations of other storage objects such as a database, this value might be in other units of storage.

Return to top


Property: DomainIdentity (read-only)
Summary
Gets a domain identity that scopes isolated storage.
C# Syntax:
public object DomainIdentity {get;}
Exceptions
Exception Type Condition
SecurityException The code lacks the required SecurityPermission to access this object. These permissions are granted by the runtime based on security policy.
InvalidOperationException The IsolatedStorage is not isolated by the domain IsolatedStorageScope.
.NET Framework Security:
SecurityPermission for the ability to access evidence. Associated enumeration: SecurityPermissionFlag.ControlPolicy

Return to top


Property: MaximumSize (read-only)
Summary
Gets a value representing the maximum amount of space available for isolated storage. When overridden in a derived class, this value can take on different units of measure.
This member is not CLS Compliant

C# Syntax:
[CLSCompliant(false)]
public virtual ulong MaximumSize {get;}
Exceptions
Exception Type Condition
InvalidOperationException The quota has not been defined.
Remarks
The default implementation of IsolatedStorage.MaximumSize returns the value of IsolatedStoragePermission.UserQuota, which is expressed in bytes. Derived classes can express the value in other units of measure. A potential example of such an implementation is an isolated storage database.

You cannot set IsolatedStorage.MaximumSize, but the quota is configured in the security policy, and can be set. Code receives a quota of space on the basis of its evidence, so the same code can receive a different quota if it is run with different evidence (for example, the same application run locally and from a share on an intranet can receive different quotas). IsolatedStorageFile.MaximumSize implements this property.

Return to top


Property: Scope (read-only)
Summary
Gets an IsolatedStorageScope enumeration value specifying the scope used to isolate the store.
C# Syntax:
public IsolatedStorageScope Scope {get;}
Remarks
Stores are isolated by a combination of factors (user, assembly, domain, and so on).

Return to top


Property: SeparatorExternal (read-only)
Summary
Gets a backslash character that can be used in a directory string. When overridden in a derived class, another character might be returned.
C# Syntax:
protected virtual char SeparatorExternal {get;}
Remarks


Notes to inheritors: When you inherit from IsolatedStorage, you can override IsolatedStorage.SeparatorExternal and return a character other than the '\' to control the naming syntax of the store. In a Windows IsolatedStorageFile this separator is a '\'.

Return to top


Property: SeparatorInternal (read-only)
Summary
Gets a period character that can be used in a directory string. When overridden in a derived class, another character might be returned.
C# Syntax:
protected virtual char SeparatorInternal {get;}
Remarks


Notes to inheritors: When you inherit from IsolatedStorage, you can override IsolatedStorage.SeparatorInternal and return a character other than the '.' to control the naming syntax of the store. In a Windows IsolatedStorageFile this separator is a '.'.

Return to top


Method: CreateObjRef(
   Type requestedType
)
Inherited
See base class member description: System.MarshalByRefObject.CreateObjRef

Summary
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
C# Syntax:
public virtual ObjRef CreateObjRef(
   Type requestedType
);
Parameters:

requestedType

The Type of the object that the new ObjRef will reference.

Return Value:
Information required to generate a proxy.
Exceptions
Exception Type Condition
RemotingException This instance is not a valid remoting object.

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~IsolatedStorage();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetLifetimeService()
Inherited
See base class member description: System.MarshalByRefObject.GetLifetimeService

Summary
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
C# Syntax:
public object GetLifetimeService();
Return Value:
An object of type ILease used to control the lifetime policy for this instance.
Remarks
For more information about lifetime services, see the LifetimeServices class.

Return to top


Method: GetPermission(
   PermissionSet ps
)
Summary
When implemented by a derived class, returns a permission that represents access to isolated storage from within a permission set.
C# Syntax:
protected abstract IsolatedStoragePermission GetPermission(
   PermissionSet ps
);
Parameters:

ps

The PermissionSet that contains the set of permissions granted to code attempting to use isolated storage.

Return Value:
An IsolatedStoragePermission object.
Remarks
You call this method on derived classes to determine what permission type governs their use, and to return the permission of the type that has been granted. Use this information to determine the allowable quota and any other derived class-specific isolated storage settings.

See derived classes for more information. IsolatedStorageFile.GetPermission implements this method.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: InitializeLifetimeService()
Inherited
See base class member description: System.MarshalByRefObject.InitializeLifetimeService

Summary
Obtains a lifetime service object to control the lifetime policy for this instance.
C# Syntax:
public virtual object InitializeLifetimeService();
Return Value:
An object of type ILease used to control the lifetime policy for this instance. This is the current lifetime service object for this instance if one exists; otherwise, a new lifetime service object initialized to the value of the LifetimeServices.LeaseManagerPollTime property.
Remarks
For more information about lifetime services, see the LifetimeServices class.
Example
The following code example demonstrates creating a lease.
 public class MyClass : MarshalByRefObject
 {
   public override Object InitializeLifetimeService()
   {
     ILease lease = (ILease)base.InitializeLifetimeService();
     if (lease.CurrentState == LeaseState.Initial)
     {
          lease.InitialLeaseTime = TimeSpan.FromMinutes(1);
          lease.SponsorshipTimeout = TimeSpan.FromMinutes(2);
           lease.RenewOnCallTime = TimeSpan.FromSeconds(2);
     }
       return lease;
   }
 }

    

Return to top


Method: InitStore(
   IsolatedStorageScope scope,
   Type domainEvidenceType,
   Type assemblyEvidenceType
)
Summary
Initializes a new instance of the IsolatedStorage object.
C# Syntax:
protected void InitStore(
   IsolatedStorageScope scope,
   Type domainEvidenceType,
   Type assemblyEvidenceType
);
Parameters:

scope

A bitwise combination of the IsolatedStorageScope values. A bitwise combination of the IsolatedStorageScope values.

domainEvidenceType

The type of the Evidence that you can chose from the list of Evidence present in the domain of the calling application.null lets the IsolatedStorage choose the evidence. The type of the Evidence that you can chose from the list of Evidence present in the domain of the calling application.null lets the IsolatedStorage choose the evidence.

assemblyEvidenceType

The type of the Evidence that you can chose from the list of Evidence present in the domain of the calling application.null lets the IsolatedStorage choose the evidence. The type of the Evidence that you can chose from the list of Evidence present in the domain of the calling application.null lets the IsolatedStorage choose the evidence.

Exceptions
Exception Type Condition
IsolatedStorageException The assembly specified has insufficient permissions to create isolated stores.
Remarks
Derived classes use this method to initialize a new instance.
.NET Framework Security:
IsolatedStorageFilePermission for permission to use isolated storage. Associated enumeration: IsolatedStorageContainment.DomainIsolationByUser

-or-

IsolatedStorageContainment.AssemblyIsolationByUser

-or-

IsolatedStorageContainment.DomainIsolationByRoamingUser

-or-

IsolatedStorageContainment.AssemblyIsolationByRoamingUser

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Remove()
Summary
When overridden in a derived class, removes the individual isolated store and all contained data.
C# Syntax:
public abstract void Remove();
Return Value:
This is an abstract method in this base class; it must be implemented by derived classes.
Remarks
See derived class for details. IsolatedStorageFile.Remove implements this method.

Return to top


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.