Exemple #1
0
        private void MarketplaceHubTask2_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            MarketplaceHubTask marketplaceHubTask = new MarketplaceHubTask();

            marketplaceHubTask.ContentType = MarketplaceContentType.Music;
            marketplaceHubTask.Show();
        }
        private void MarketplaceHub_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            MarketplaceHubTask mht = new MarketplaceHubTask();

            mht.ContentType = MarketplaceContentType.Applications;
            mht.Show();
        }
Exemple #3
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            MarketplaceHubTask mht = new MarketplaceHubTask();

            //mht.ContentType = MarketplaceContentType.Applications;
            mht.ContentType = MarketplaceContentType.Music;
            mht.Show();
        }
Exemple #4
0
        private void marketplaceHub_Click(object sender, EventArgs e)
        {
            var task = new MarketplaceHubTask
            {
                ContentType = MarketplaceContentType.Applications
            };

            task.Show();
        }
Exemple #5
0
        private void btnMusic_Click(object sender, RoutedEventArgs e)
        {
            //创建一个进入应用市场的任务
            MarketplaceHubTask mht = new MarketplaceHubTask();

            //设置为音乐类别
            mht.ContentType = MarketplaceContentType.Music;
            //启动任务
            mht.Show();
        }
Exemple #6
0
        private void btnApp_Click(object sender, RoutedEventArgs e)
        {
            //创建一个进入应用市场的任务
            MarketplaceHubTask mht = new MarketplaceHubTask();

            //设置为应用程序类别
            mht.ContentType = MarketplaceContentType.Applications;
            //启动任务
            mht.Show();
        }
        private void Button_clicked(object sender, RoutedEventArgs e)
        {
            Button current_button = (Button)sender;
            String button_name = current_button.Name;
            switch (button_name)
            {
                case "message":
                    //MessageBox.Show("message button clicked");
                    SmsComposeTask sms = new SmsComposeTask();
                    sms.To = "";
                    sms.Show();
                    break;
                case "calendar":
                    //MessageBox.Show("Canlendar button clicked");
                    WebBrowserTask webBrowserTask1 = new WebBrowserTask();
                    webBrowserTask1.Uri = new Uri("http://calendar.google.com/", UriKind.Absolute);
            webBrowserTask1.Show();
                    break;
                case "photos":
                     PhotoChooserTask photo = new PhotoChooserTask();
            photo.Show();
                    break;
                case "camera":
                    CameraCaptureTask cam = new CameraCaptureTask();
                    cam.Show();
                    break;
                case "youtube":
                     WebBrowserTask webBrowserTask2 = new WebBrowserTask();
                     webBrowserTask2.Uri = new Uri("http://m.youtube.com/", UriKind.Absolute);
            webBrowserTask2.Show();
                    break;
                case "stocks":
                    break;
                case "maps":
                    //MessageBox.Show("maps clicked");
                    BingMapsTask bmt = new BingMapsTask();
            //bmt.Center = new GeoCoordinate(-27.5, 153);
            bmt.SearchTerm = "New York";
            bmt.Show();
                    break;
                case "weather":
                    WebBrowserTask webBrowserTask3 = new WebBrowserTask();
                    webBrowserTask3.Uri = new Uri("http://www.weather.com/", UriKind.Absolute);
            webBrowserTask3.Show();

                    break;
                case "notes":
                    break;
                case "voice_memos":
                    break;
                case "itunes":
                     MarketplaceHubTask market1 = new MarketplaceHubTask();
                    market1.Show();
                    break;
                case "app_store":
                     MarketplaceHubTask market = new MarketplaceHubTask();
                    market.Show();
                    break;
                case "settings":
                    break;
                case "phone":
                    phoneNumberChooserTask = new PhoneNumberChooserTask();
                    phoneNumberChooserTask.Completed += new EventHandler<PhoneNumberResult>(phoneNumberChooserTask_Completed);
                    try
                    {
                        phoneNumberChooserTask.Show();
                    }
                    catch (System.InvalidOperationException ex)
                    {
                        MessageBox.Show("An error occurred.");
                    }
                    //PhoneCallTask phoneCallTask = new PhoneCallTask();

                    //phoneCallTask.PhoneNumber = "123456789";
                    //phoneCallTask.DisplayName = "Shadowfax Apps";

                    //phoneCallTask.Show();
                    break;
                case "mail":
                    EmailComposeTask emailComposeTask = new EmailComposeTask();
            emailComposeTask.Subject = "";
            emailComposeTask.Body = "";
            emailComposeTask.To = "";
            emailComposeTask.Show();
                    break;
                case "safari":
                    WebBrowserTask webBrowserTask4 = new WebBrowserTask();
            webBrowserTask4.Uri = new Uri("http://www.google.com", UriKind.Absolute);
            webBrowserTask4.Show();
                    break;
                case "ipod":

                    break;

                default:
                    break;
            }
        }
 private void marketplaceHub_Click(object sender, EventArgs e)
 {
     var task = new MarketplaceHubTask
     {
         ContentType = MarketplaceContentType.Applications
     };
     task.Show();
 }
        private void FirstListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            switch ((e.AddedItems[0] as ListBoxItem).Name)
            {
            case "iEmailComposeTask":
                EmailComposeTask ect = new EmailComposeTask();
                ect.To      = "*****@*****.**";
                ect.Subject = "Some subject";
                ect.Body    = "email content here";
                ect.Show();
                break;

            case "iMarketplaceDetailTask":
                MarketplaceDetailTask mdt = new MarketplaceDetailTask();
                mdt.ContentType = MarketplaceContentType.Applications;
                mdt.Show();
                break;

            case "iMarketplaceHubTask":
                MarketplaceHubTask mht = new MarketplaceHubTask();
                mht.ContentType = MarketplaceContentType.Applications;
                mht.Show();
                break;

            case "iMarketplaceReviewTask":
                MarketplaceReviewTask mrt = new MarketplaceReviewTask();
                mrt.Show();
                break;

            case "iMarketplaceSearchTask":
                MarketplaceSearchTask mst = new MarketplaceSearchTask();
                mst.ContentType = MarketplaceContentType.Music;
                mst.SearchTerms = "Radiohead";
                mst.Show();
                break;

            case "iMediaPlayerLauncher":
                MediaPlayerLauncher mpl = new MediaPlayerLauncher();
                mpl.Media    = new Uri("", UriKind.Relative);
                mpl.Location = MediaLocationType.Data;
                mpl.Controls = MediaPlaybackControls.Pause |
                               MediaPlaybackControls.Stop |
                               MediaPlaybackControls.Rewind;
                mpl.Show();
                break;

            case "iPhoneCallTask":
                PhoneCallTask pct = new PhoneCallTask();
                pct.DisplayName = "My contact";
                pct.PhoneNumber = "55512345678";
                pct.Show();
                break;

            case "iSearchTask":
                SearchTask st = new SearchTask();
                st.SearchQuery = "Facebook";
                st.Show();
                break;

            case "iSmsComposeTask":
                SmsComposeTask sct = new SmsComposeTask();
                sct.To   = "My contact";
                sct.Body = "sms content";
                sct.Show();
                break;

            case "iWebBrowserTask":
                WebBrowserTask wbt = new WebBrowserTask();
                wbt.URL = "http://www.apress.com";
                wbt.Show();
                break;
            }
        }