Share via


DatastoreManager 클래스

업데이트: 2007년 11월

데이터 저장소의 정보에 액세스하며 데스크톱 컴퓨터의 데이터 저장소에서 Platform 개체를 열거하고 가져오는 메서드를 제공합니다.

네임스페이스:  Microsoft.SmartDevice.Connectivity
어셈블리:  Microsoft.SmartDevice.Connectivity(Microsoft.SmartDevice.Connectivity.dll)

구문

Public Class DatastoreManager

Dim instance As DatastoreManager
public class DatastoreManager
public ref class DatastoreManager
public class DatastoreManager

설명

이 클래스는 이 네임스페이스에서 항상 첫 번째로 사용됩니다.

데이터 저장소에는 데스크톱 컴퓨터에 등록된 플랫폼 및 장치에 대한 정보가 들어 있습니다. 데이터 저장소에 대한 자세한 내용은 스마트 장치 연결 API를 사용하여 장치 제어를 참조하십시오.

예제

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

스레드로부터의 안전성

이 형식의 모든 공용 static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.

참고 항목

참조

DatastoreManager 멤버

Microsoft.SmartDevice.Connectivity 네임스페이스