Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Platform Class

Visual Studio 2008

Represents a Windows CE based platform, such as Windows Mobile 5.0 Pocket PC, that is registered in the Datastore.

Namespace:  Microsoft.SmartDevice.Connectivity
Assembly:  Microsoft.SmartDevice.Connectivity (in Microsoft.SmartDevice.Connectivity.dll)

public class Platform

This class does not have any constructors. To get an instance, use DatastoreManager.GetPlatform or DatastoreManager.GetPlatforms.

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("    OSVersion: " + platform.GetOSVersion().ToString());
            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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2015 Microsoft