Export (0) Print
Expand All

IsolatedStorageScope Enumeration

Enumerates the levels of isolated storage scope that are supported by IsolatedStorage.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

[Visual Basic]
<Flags>
<Serializable>
Public Enum IsolatedStorageScope
[C#]
[Flags]
[Serializable]
public enum IsolatedStorageScope
[C++]
[Flags]
[Serializable]
__value public enum IsolatedStorageScope
[JScript]
public
   Flags
 Serializable
enum IsolatedStorageScope

Remarks

Use IsolatedStorageScope to specify a degree of scope for an isolated store. You can specify combinations of these levels that are supported by IsolatedStorage.

Members

Member name Description Value
Assembly Isolated storage scoped to the identity of the assembly. 4
Domain Isolated storage scoped to the application domain identity. 2
None No isolated storage usage. 0
Roaming 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). 8
User Isolated storage scoped by user identity. 1

Example

[Visual Basic, C#, C++] The following code example demonstrates how the IsolatedStorageScope enumeration is used in the GetStore methods.

[Visual Basic] 
' Retrieve an IsolatedStorageFile for the current Domain and Assembly.
Dim isoFile As IsolatedStorageFile = _
    IsolatedStorageFile.GetStore(IsolatedStorageScope.User _
    Or IsolatedStorageScope.Assembly _
    Or IsolatedStorageScope.Domain, Nothing, Nothing)

Dim isoStream As New IsolatedStorageFileStream(Me.userName, FileMode.Open, _
    FileAccess.Read, FileShare.Read)

[C#] 

                // Retrieve an IsolatedStorageFile for the current Domain and Assembly.
                IsolatedStorageFile isoFile =
                    IsolatedStorageFile.GetStore(IsolatedStorageScope.User |
                    IsolatedStorageScope.Assembly |
                    IsolatedStorageScope.Domain ,
                    null,
                    null);

                IsolatedStorageFileStream isoStream =
                    new IsolatedStorageFileStream( this.userName,
                    FileMode.Open,
                    FileAccess.Read,
                    FileShare.Read);  

[C++] 
// Retrieve an IsolatedStorageFile for the current Domain and Assembly.
IsolatedStorageFile* isoFile =
   IsolatedStorageFile::GetStore(
   static_cast<IsolatedStorageScope>(IsolatedStorageScope::User | 
   IsolatedStorageScope::Assembly |
   IsolatedStorageScope::Domain),
   (Type*)0, 0);
IsolatedStorageFileStream* isoStream = new IsolatedStorageFileStream(this->userName,
   FileMode::Open,  
   FileAccess::ReadWrite,
   isoFile);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: System.IO.IsolatedStorage

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Mscorlib (in Mscorlib.dll)

See Also

System.IO.IsolatedStorage Namespace | Types of Isolation

Show:
© 2014 Microsoft