1,//phonecalltask: Call
private void Btnphonecall_click (object sender, RoutedEventArgs e)
{
Phonecalltask task = new Phonecalltask ();
Task. PhoneNumber = "110";
Task. DisplayName = "Autumn Moonlight Xuan";
Task. Show ();
}
2.//smscomposetask: Send SMS
private void Btncomposesms_click (object sender, RoutedEventArgs e)
{
Smscomposetask task = new Smscomposetask ();
Task. to = "110";
Task. Body = "Hello!.";
Task. Show ();
}
3.//emailcomposetask: Send mail
Emailcomposetask task = new Emailcomposetask ();
Task. to = "[email protected]";
Task. Cc = "[email protected]";
Task. Subject = "Autumn Moonlight Xuan Test";
Task. Body = "Hello world! ";
Task. Show ();
4.//webbrowsertask: Open Web browser
private void Btnlaunchwebbrowser_click (object sender, RoutedEventArgs e)
{
Webbrowsertask task = new Webbrowsertask ();
Task. URL = "<a href=" http://http://www.cnblogs.com/qiuyueguangxuan/">http://www.cnblogs.com/qiuyueguangxuan</ A> ";
Task. Show ();
}
5.//searchtask: Search function
private void Btnlaunchsearch_click (object sender, RoutedEventArgs e)
{
Searchtask task = new Searchtask ();
Task. SearchQuery = "Autumn Moonlight Xuan";
Task. Show ();
}
6.//mediaplayerlauncher: Start Media Player
Mediaplayerlauncher task = new Mediaplayerlauncher ();
Task. Media = new Uri (@ "http://www.baidu.com/11.wmv");
Task. Show ();
7,//cameracapturetask: The task of taking pictures
private void Button1_Click (Object Sender,routedeventargs e)
{
Cameracapturetask camertask=new cameracapturetask ();
Camertask.completed+=new eventhandler<photoresult> (cameratask_completed);
Cameratask.show ();
}
void Cameratask_completed (object sender, Photoresult e)
{
Execute the code after the photo is completed
BitmapImage image=new BitmapImage ();
Image. SetSource (E.chosenphoto);
Image1. Source=image;
}
8,//photochoosertask call picture program, select Picture, and can be cut in meditation
Photochoosertask photo=new photochoosertask ();
Public Multiplemediatask ()//constructor
{
InitializeComponent ();
photocompleted + = new eventhandler<photoresult> (photo_completed);
}
void Photo_completed (object sender, Photoresult e)
{
BitmapImage image=new BitmapImage ();
Image. SetSource (E.chosenphoto);
Image1. Source=image;
}
9.//saveemailaddresstask Call the contact program and save the set email address to the selected contact or new contact.
private void Emailsavebtn_click (object sender, RoutedEventArgs e)
{
Saveemailaddresstask emailsave = new Saveemailaddresstask ();
Emailsave. email = "[email protected]"; emailsave.completed + = new eventhandler<taskeventargs> (emailsave_completed);
Emailsave. Show ();
}
void Emailsave_completed (object sender, Taskeventargs e)
{
Execute code after processing is saved
}
10,//emailaddresschoosertask Open the contact program, choose Contact email address</p>
private void Emailchooser_click (object sender, RoutedEventArgs e)
{
Emailaddresschoosertask emailchooser = new Emailaddresschoosertask ();
emailchooser.completed + = new eventhandler< Emailresult> (emailchooser_completed);
Emailchooser. Show ();
}
void Emailchooser_completed (object sender, Emailresult e)
{
This. Pagetitle.text = E.email;
}
Common tasks in Windows Phone 7