19 Feb 2008

Managed CoreConnectivity Framework in VS2008

Objectif
Créer un lien entre le périphérique et Visual Studio 2008
Connect the device to Visual Studio 2008

Description
  • Basé sur le core connectivity framework natif existant.
  • Build on top of existing core connectivity framework.
  • Utilisé en interne par les outils MS (tels que Unit Testing, remote…)
  • Internally used by MS tools (e.g., unit testing)
  • Facilité accrue pour créer rapidement ses propres remote tools
  • Makes it easy to build your own remote tools

Pour l’utiliser :
To use:
Ajouter une référence à Microsoft.Smartdevice.Connectivity.dll
Add a reference to Microsoft.Smartdevice.Connectivity.dll

Exemple de code :
Code example:

DatastoreManager dsmgrObj = new DatastoreManager(1033);
//Get Collection of platforms entries present in Data store
IEnumerable platformcollection = dsmgrObj.GetPlatforms();
//Iterate through Collection of platforms
foreach (Platform objplatform in platformcollection)
{
System.Console.WriteLine(objplatform.Name);
if (objplatform.Name.Contains("Windows Mobile 6 Professional SDK"))
{
IEnumerable pdeviceCollection = objplatform.GetDevices();
foreach (Device objdevice in pdeviceCollection)
{
System.Console.WriteLine("\t" + objdevice.Name);
//Check if the device is an emulator
if (objdevice.Name.Contains("Windows Mobile 6 Professional Emulator"))
{
m_objDevice = objdevice;
m_objDevice.Connect();
return;
}
}
}


// To get all running processes on the device
m_objDevice.GetRunningProcesses()

// Get the system info
SystemInfo info = m_objDevice.GetSystemInfo();

N'hésitez pas à tester et créer vos propres Remote Tools, c'est super pratique.
Don't hesitate to test it and create your own Remote Tools, it is very usefull.

1 comment:

Fredrik Paulsson said...

What is the difference between the "Managed CoreConnectivity Framework" and the "Remote Tools Framework 1.0" released earlier?

Cheers,
Fredrik Paulsson