Classe DatastoreManager
Aggiornamento: novembre 2007
Accede a informazioni nell'archivio dati e fornisce metodi per enumerare e ottenere oggetti Platform nell'Archivio dati del computer desktop.
Spazio dei nomi: Microsoft.SmartDevice.Connectivity
Assembly: Microsoft.SmartDevice.Connectivity (in Microsoft.SmartDevice.Connectivity.dll)
Public Class DatastoreManager
Dim instance As DatastoreManager
public class DatastoreManager
public ref class DatastoreManager
public class DatastoreManager
È sempre la prima classe utilizzata in questo spazio dei nomi.
Archivio dati contiene informazioni su piattaforme e dispositivi registrati sul computer desktop. Per ulteriori informazioni su Archivio dati, vedere Controllo dei dispositivi mediante l'API di connettività per Smart Device.
Imports System
Imports System.Collections.ObjectModel
Imports Microsoft.SmartDevice.Connectivity
Class Example
Shared Sub Main(ByVal args() As String)
' Get datastore object
Dim dsmgr As New DatastoreManager(1033)
' Get the platforms in the Datastore
Dim platforms As Collection(Of Platform) = dsmgr.GetPlatforms()
' For each platform, output name and ID
Console.WriteLine("Get all platforms with the GetPlatforms method: " + vbCr + vbLf)
Dim platform As Platform
For Each platform In platforms
Console.WriteLine("Platform Name: " + platform.Name + " ID: " + _
platform.Id.ToString())
Next platform
' Get the Windows Mobile 5.0 Smartphone platform
Dim wm5sp As New ObjectId(New Guid("BD0CC567-F6FD-4ca3-99D2-063EFDFC0A39"))
Dim p As Platform = dsmgr.GetPlatform(wm5sp)
' Output information
Console.WriteLine(vbCr + vbLf + vbCr + vbLf + _
"Get the WM5 Smartphone platform using the GetPlatform method: " + _
vbCr + vbLf)
Console.WriteLine("Platform Name: " + p.Name + " ID: " + p.Id.ToString())
Console.ReadLine()
End Sub 'Main
End Class 'Example
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();
}
}
System.Object
Microsoft.SmartDevice.Connectivity.DatastoreManager
Qualsiasi membro static (Shared in Visual Basic) pubblico di questo tipo è thread-safe. I membri di istanza non sono garantiti come thread-safe.