.NET Components for Mobility

ConnectionManager.DetailedStatus notification events?

Last post 05-16-2008 6:13 AM by Rich. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-15-2008 10:49 AM

    • Rich
    • Top 500 Contributor
    • Joined on 05-15-2008
    • Posts 2

    ConnectionManager.DetailedStatus notification events?

    Hi,

    I want to use either the PC or WiFi connection, whichever is currently available, but in order to determine this (to then be able to determine if it is actually connected) it looks like I need to poll ConnectionManager.DetailedStatus to see what connections are available.

    More specifically, the problem is this:

    I can enumerate the list of available connections by calling:

    ConnectionDetailedStatus[ aDetailedStatus = ConnectionManager.DetailedStatus;

    When the device is not connected to a computer, the PC connenction doesn't appear in this list. Similarly, when the device is connected to a computer, the WiFi connection doesn't appear in this list.

    Is there any way of receiving a notification when the items in this list change, as there is for receiving a notification when the status of a specific connection changes?

    Example:

    Imagine the device is connected to a WiFi network and it then loses connectivity. Sometime later, the user plugs the device into a PC. How does the application know the device is now connected to a PC without polling (and therefore refreshing) this list?

    Regards,
    Richard

  • 05-16-2008 4:51 AM In reply to

    Re: ConnectionManager.DetailedStatus notification events?

    The best way to track changes in the connections available is to use the Status namespace - Connections* properties allow you to monitor when the number of different types of connection change (e.g. ConnectionsNetworkCount for WiFi and ConnectionsDesktopCount for desktop pass-through), you can then use ConnectionManager.DetailedStatus to get more detail about the specific connections.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 05-16-2008 6:13 AM In reply to

    • Rich
    • Top 500 Contributor
    • Joined on 05-15-2008
    • Posts 2

    Re: ConnectionManager.DetailedStatus notification events?

    Excellent, thanks Peter, this is exactly what I was after.

    Regards,

    Richard

Page 1 of 1 (3 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.