在Windows Phone 7模拟器中调用People Hub(译文)
By robot-v1.0
本文链接 https://www.kyfws.com/emulation/invoking-people-hub-in-windows-phone-emulator-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 4 分钟阅读 - 1605 个词 阅读量 0在Windows Phone 7模拟器中调用People Hub(译文)
原文地址:https://www.codeproject.com/Articles/289826/Invoking-People-Hub-in-Windows-Phone-Emulator
原文作者:Mohib Sheth
译文由本站 robot-v1.0 翻译
前言
Invoking People Hub in Windows Phone 7 Emulator
在Windows Phone 7模拟器中调用People Hub
介绍(Introduction)
很多时候,您的应用程序将需要访问用户的联系人.幸运的是,Windows Phone仿真器为您提供了一些可以访问的虚拟联系人条目.(Many a times, your application would require to access the contacts of the user. Fortunately, the Windows Phone Emulator provides you with a few dummy contact entries which you can access.)
但是这些联系人是空洞的,没有照片,生日,周年纪念日,个人地址等数据.(But these contacts are bare bones and they don’t feature data like photo, birthday, anniversary, personal address and so on.)
如果您是Windows Phone 7开发人员,则必须在某个时间或其他时间使用模拟器.如果您没有记错的话,您将不会在模拟器上看到这些屏幕.启动模拟器时显示的唯一图标是Internet Explorer.单击右箭头时,您将获得应用程序(如果已部署),Internet Explorer,设置的列表.(If you are a Windows Phone 7 Developer, you must have used the Emulator some or the other time. If you remember well, you will not have seen these screens before on the emulator. The only icon which shows up when you fire up the Emulator is of Internet Explorer. On clicking the right arrow, you get a list of Your application (if deployed), Internet Explorer, Settings.)
我不确定为什么微软没有在Windows Phone Emulator上放置People Hub Tile,但是有一种解决方法,可以调用它并进行所需的任何更改.您甚至可以添加联系人,并与Windows Live,Gmail,Outlook,Facebook等帐户关联.(I am not sure why Microsoft did not put up the People Hub Tile on Windows Phone Emulator but there is a workaround of invoking it and do whatever changes you need. You can even add contacts, link with accounts for Windows Live, Gmail, Outlook, Facebook and others.)
使用代码(Using the Code)
在Visual Studio中创建一个新的Windows Phone应用程序项目.在MainPage上,只需添加一个Button并双击Button,这将为Button创建一个Click Event Handler.(Create a New Windows Phone Application project in Visual Studio. On MainPage, just add a Button and double click on the Button which will create a Click Event Handler for the Button.)
在代码视图中,找到事件处理程序(应将其命名为(In the Code View, find the event handler (it should be named as) button1_Click
等),然后输入此代码.(or such) and type this code.)
PhoneCallTask task = new PhoneCallTask();
task.PhoneNumber = "000000000";
task.DisplayName = "Test user";
task.Show();
您需要添加一个(You would need to add a) Using
声明(statement for) Microsoft.Phone.Tasks
.按Ctrl + F5启动项目.(. Press Ctrl + F5 to start the project.)
我们在这里正在做的是打一个电话(不用担心,因为仿真器使用的是伪GSM,因此您不会被充电).一旦手机连接好,计时器就会开始计时您的通话秒数…(What we are doing here is initiating a phone call (don’t worry, you won’t get charged as the Emulator uses Fake GSM). Once your phone is connected and a timer starts counting your call seconds…)
…单击"添加呼叫"按钮,这将使您的呼叫处于保持状态,并显示一个屏幕,其中包含用于拨打其他号码的选项.(…click on “add call” button which will put your call on Hold and show you a screen with options to dial another number.)
在底部的应用程序栏中,单击带有日记图标的第三个按钮,这将启动您的People Hub,供您修改.(In the Application Bar at the bottom, click the third button with Diary icon which will fire up your People Hub for you to tinker around with.)
现在,您可以单击顶部的状态栏,然后结束通话.不用担心,它不会关闭人脉中心.结束通话后,模拟器将返回People Hub屏幕,供您修改.您可以更改默认联系人,创建自己的联系人,与Windows Live,Outlook,Gmail等帐户链接.(You can now click on the Status Bar at the top and end the call. Don’t worry, it won’t close down the People Hub. Once you ended the call, the emulator will return to People Hub screen for you to tinker around with. You can make changes to the default contacts, create your own contacts, link with accounts such as Windows Live, Outlook, Gmail, etc.)
关联帐户(例如Gmail)后,您甚至可以从此处阅读邮件.(Once you link an account say Gmail, you can even read mails from here.)
历史(History)
- 26(26)日(th)2011年11月:初始职位(November, 2011: Initial post)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
C# Windows-Phone-7 Mobile Silverlight VS2010 Visual-Studio Dev 新闻 翻译