File Explorers for Isolated Storage

,

The Windows Phone SDK comes with a tool that allows you to read and write to your app’s isolated storage area via the command line. The first part of this section examines the Isolated Storage Explorer present in the Windows Phone SDK. The second part examines a free alternative third-party explorer named WP7 Isolated Storage Explorer.

Windows Phone SDK Isolated Storage Explorer

Depending on your operating system, Isolated Storage Explorer is installed in one of following locations:

Image Program FilesMicrosoft SDKsWindows Phonev8.0ToolsIsolatedStorageExplorerTool

Image Program Files (x86)Microsoft SDKsWindows Phonev8.0ToolsIsolatedStorageExplorerTool

When using Isolated Storage Explorer, your app must be deployed to the device or emulator. The emulator or device must be running, but the app does not have to be running.

Isolated Storage Explorer uses the following syntax:

ISETool.exe <ts|rs|dir[:device-folder]> <xd|de> <Product GUID> [<desktop-path>]

Table 29.2 lists the command-line options for Isolated Storage Explorer.

TABLE 29.2. Isolated Storage Explorer Command-Line Options

Image

Source: http://msdn.microsoft.com/en-us/library/hh286408(v=vs.92).aspx

To use the Isolated Storage Explorer, open a command window and navigate to the location of ISETool.exe. Retrieve the product GUID from the ProductID attribute of the App element in the project’s WMAppManifest.xml file.

Listing the files and directories at the root directory of an app’s isolated storage area can be done using the following command (replacing the GUID with your app’s product GUID):

ISETool.exe dir xd 11111111-2222-3333-4444-555555555555

To copy all the files from isolated storage to your computer, use the following command:

ISETool.exe ts xd 11111111-2222-3333-4444-555555555555 "C:Phone"

This command creates a directory on your computer named C:PhoneIsolatedStore and copies the files and directories in isolated storage into the directory.


Caution

If the IsolatedStore directory exists and the copy command is performed, the contents of the IsolatedStore directory are overwritten without any warning.


Use the following command to replace all the files in isolated storage with files from your computer:

SETool.exe rs xd 11111111-2222-3333-4444-555555555555 "C:PhoneIsolatedStore"

WP7 Isolated Storage Explorer

A useful alternative to the built-in Isolated Storage Explorer is the WP7 Isolated Storage Explorer, which can be found at http://wp7explorer.codeplex.com/. This open source tool can be used to retrieve a local database from isolated storage, and it works both on the emulator and a real device. The advantage of the WP7 Isolated Storage Explorer is that it comes with a GUI.

The tool can be used either as a standalone application or within Visual Studio and provides a dockable tool window that displays the contents of your app’s isolated storage directory (see Figure 29.6).

Image

FIGURE 29.6 WP7 Isolated Storage Explorer dockable window.

WP7 Isolated Storage Explorer uses WCF service to communicate with your app.

After installing the tool, to use it in your project, add a reference to the IsolatedStorageExplorer assembly, and then add some initialization code to your app’s launching and activated events, as shown:

void Application_Launching(object sender, LaunchingEventArgs e)
{
    IsolatedStorageExplorer.Explorer.Start("localhost");
}

void Application_Activated(object sender, ActivatedEventArgs e)
{
    IsolatedStorageExplorer.Explorer.RestoreFromTombstone();
}

The capability to retrieve files from isolated storage and open them on your desktop is very useful, and being able to retrieve a local database from isolated storage means that it can then be loaded into Visual Studio or SQL Server Management Studio, allowing you to explore the schema and to verify the results of your mapping attributes. It is also possible to modify the structure of a database and use the SqlMetal tool to generate your data model, including its DataContext and entity classes. The database-first approach using SqlMetal is discussed in a later section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.177.151