检测Windows Phone 7是否已连接到桌面Zune软件 [英] Detect if Windows Phone 7 is connected to desktop Zune software

查看:69
本文介绍了检测Windows Phone 7是否已连接到桌面Zune软件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Windows Phone 7应用程序上工作了几个月,并且收集了一些有用的检测标志,这些标志用于在后台/前景线程上测试代码是否在模拟器中运行。 ,或在设计时。 (请参见此处完整列表

I've been working on a Windows Phone 7 app for a few months now and have a collection of useful detection flags that are used to test for things like if the code is running in the emulator, on a background/foreground thread, or at design time. (see full list here)

我现在想添加一个新标志,该标志将检查手机是否使用USB电缆连接到台式机,以防止用户报告问题。当电话连接到Zune软件时,某些操作被阻止,例如,您无法使用摄像头(它将打开,然后使用e.TaskResult == Microsoft.Phone.Tasks.TaskResult.Cancel立即关闭)。这使我的应用程序认为用户取消了照片,由于应用程序无法正常工作,用户误解了照片。

I now want to add a new flag that will check if the phone is connected to a desktop using a USB cable to prevent issues that users are reporting. There are certain operations that are blocked while the phone is connected to the Zune software, for example you cannot use the camera (it will just open and then immediately close with e.TaskResult == Microsoft.Phone.Tasks.TaskResult.Cancel). This causes my app to think that the user canceled the photo, which the user miss-interprets as the app not working correctly.

我想检测手机何时已连接到Zune软件,并提供一条消息,指出相机必须先断开连接,然后才能工作。

I'd like to detect when the phone is connected to the Zune software and provide a message saying the camera will not work until they disconnect it. Is there any way to do this?

推荐答案

Gabor Dolhai在 Zune检测和网络意识,它结合使用NetworkInterfaceType检测和NetworkAddressChangeed事件

Gabor Dolhai has a full blog post on Zune Detection and Network Awareness, which uses a combiantion of NetworkInterfaceType detection and the NetworkAddressChangeed event.

这篇关于检测Windows Phone 7是否已连接到桌面Zune软件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆