Share via


Platform クラス

更新 : 2007 年 11 月

データストアに登録されている Windows CE ベースのプラットフォーム (Windows Mobile 5.0 Pocket PC など) を表します。

名前空間 :  Microsoft.SmartDevice.Connectivity
アセンブリ :  Microsoft.SmartDevice.Connectivity (Microsoft.SmartDevice.Connectivity.dll 内)

構文

'宣言
Public Class Platform
'使用
Dim instance As Platform
public class Platform
public ref class Platform
public class Platform

解説

このクラスにはコンストラクタがありません。インスタンスを取得するには、DatastoreManager.GetPlatform または DatastoreManager.GetPlatforms を使用します。

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
        Dim platform As Platform
        For Each platform In platforms
            Console.WriteLine("Platform Name: " & _
                              platform.Name & "    ID: " & platform.Id.ToString())
            Console.WriteLine("    OSVersion: " & platform.GetProperty("OSVersion"))
            Console.WriteLine("    DefaultPlatform: " & _
                              platform.GetProperty("DefaultPlatform"))
            Console.WriteLine("    DefaultDevice: " & platform.GetProperty("DefaultDevice"))
            Console.WriteLine("    ShortName: " & platform.GetProperty("ShortName"))
            Console.WriteLine("    DefaultFormFactor: " & _
                              platform.GetProperty("DefaultFormFactor"))
        Next platform

        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, ID, and platform properties.
        foreach (Platform platform in platforms)
        {
            Console.WriteLine("Platform Name: " + platform.Name + "    ID: " + platform.Id);
            Console.WriteLine("    OSVersion: " + platform.GetProperty("OSVersion"));
            Console.WriteLine("    DefaultPlatform: " + 
                platform.GetProperty("DefaultPlatform"));
            Console.WriteLine("    DefaultDevice: " + platform.GetProperty("DefaultDevice"));
            Console.WriteLine("    ShortName: " + platform.GetProperty("ShortName"));
            Console.WriteLine("    DefaultFormFactor: " + 
                platform.GetProperty("DefaultFormFactor"));
        }

        Console.ReadLine();
    }
}

継承階層

System.Object
  Microsoft.SmartDevice.Connectivity.Platform

スレッド セーフ

この型のすべてのパブリック static (Visual Basic では Shared) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

参照

参照

Platform メンバ

Microsoft.SmartDevice.Connectivity 名前空間