DatastoreManager Class
Visual Studio 2008
Accesses information in the Datastore and provides methods to enumerate and get Platform objects in the desktop computer's Datastore.
Assembly: Microsoft.SmartDevice.Connectivity (in Microsoft.SmartDevice.Connectivity.dll)
This is always the first class used in this namespace.
The Datastore contains information about platforms and devices registered on the desktop computer. For more information about the Datastore, see the last section in Controlling Devices with the Smart Device Connectivity API.
using System; using System.Collections.ObjectModel; using Microsoft.SmartDevice.Connectivity; class Example { static void Main(string[] args) { // Get datastore object DatastoreManager dsmgr = new DatastoreManager(1033); // Get the platforms in the Datastore Collection<Platform> platforms = dsmgr.GetPlatforms(); // For each platform, output name and ID Console.WriteLine("Get all platforms with the GetPlatforms method: \r\n"); foreach (Platform platform in platforms) { Console.WriteLine("Platform Name: " + platform.Name + " ID: " + platform.Id); } // Get the Windows Mobile 5.0 Smartphone platform ObjectId wm5sp = new ObjectId(new Guid("BD0CC567-F6FD-4ca3-99D2-063EFDFC0A39")); Platform p = dsmgr.GetPlatform(wm5sp); // Output information Console.WriteLine("\r\n\r\nGet the WM5 Smartphone platform using the GetPlatform method: \r\n"); Console.WriteLine("Platform Name: " + p.Name + " ID: " + p.Id); Console.ReadLine(); } }