// Constructor
        public MainPage()
        {
            InitializeComponent();

            act            = new AddressChooserTask();
            act.Completed += new EventHandler <AddressResult>(act_Completed);

            cct            = new CameraCaptureTask();
            cct.Completed += new EventHandler <PhotoResult>(cct_Completed);

            eact            = new EmailAddressChooserTask();
            eact.Completed += new EventHandler <EmailResult>(eact_Completed);

            git            = new GameInviteTask();
            git.Completed += new EventHandler <TaskEventArgs>(git_Completed);

            pct            = new PhotoChooserTask();
            pct.Completed += new EventHandler <PhotoResult>(pct_Completed);

            pnct            = new PhoneNumberChooserTask();
            pnct.Completed += new EventHandler <PhoneNumberResult>(pnct_Completed);

            seat            = new SaveEmailAddressTask();
            seat.Completed += new EventHandler <TaskEventArgs>(seat_Completed);

            srt            = new SaveRingtoneTask();
            srt.Completed += new EventHandler <TaskEventArgs>(srt_Completed);

            spnt            = new SavePhoneNumberTask();
            spnt.Completed += new EventHandler <TaskEventArgs>(spnt_Completed);
        }
示例#2
0
 public MainPage()
 {
     InitializeComponent();
     _customRingtone            = new SaveRingtoneTask();
     _customRingtone.Completed += (customRingtone_Completed);
     DataContext = App.ViewModel;
     BackgroundAudioPlayer.Instance.PlayStateChanged += new EventHandler(Instance_PlayStateChanged);
 }
示例#3
0
 private void psy_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     // TODO: Add event handler implementation here.
     saveringtone             = new SaveRingtoneTask();
     saveringtone.Source      = new Uri("isostore:/psy.mp3");
     saveringtone.DisplayName = "Nơi Tình Yêu Bắt Đầu ringtone";
     saveringtone.Completed  += saveringtone_Completed;
     saveringtone.Show();
 }
示例#4
0
        private void save_ringtone(object sender, RoutedEventArgs e)
        {
            SaveRingtoneTask saveringtone = new SaveRingtoneTask();

            saveringtone.Completed += new EventHandler <TaskEventArgs>(saveringtoneChooser_Completed); //extra
            saveringtone.Source     = new Uri("appdata:/ringtone/Super_Mario_Ringtone.mp3");           // veya isolated storage'daki dosyaları da gösterebilirsiniz
            //("isostore:/Super_Mario_Ringtone.mp3");
            saveringtone.DisplayName = "Super Mario Ringtone";
            saveringtone.Show();
        }
示例#5
0
        private void mnuRingtone_Click(object sender, RoutedEventArgs e)
        {
            string fileName = ((MenuItem)sender).Tag.ToString();
            string fullName = "isostore:/Music/" + fileName;

            SaveRingtoneTask ringtoneTask = new SaveRingtoneTask();

            ringtoneTask.Source      = new Uri(fullName);
            ringtoneTask.DisplayName = fileName;
            ringtoneTask.Show();
        }
 // Sample code for building a localized ApplicationBar
 //private void BuildLocalizedApplicationBar()
 //{
 //    // Set the page's ApplicationBar to a new instance of ApplicationBar.
 //    ApplicationBar = new ApplicationBar();
 //    // Create a new button and set the text value to the localized string from AppResources.
 //    ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative));
 //    appBarButton.Text = AppResources.AppBarButtonText;
 //    ApplicationBar.Buttons.Add(appBarButton);
 //    // Create a new menu item with the localized string from AppResources.
 //    ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText);
 //    ApplicationBar.MenuItems.Add(appBarMenuItem);
 //}
 private void SaveRingtoneButton_Click(object sender, EventArgs e)
 {
     SaveRingtoneTask task = new SaveRingtoneTask()
     {
         DisplayName = "ringtones in action",
         Source = new Uri("appdata:/mytone.wma"),
         IsShareable = true,
     };
     task.Completed += saveRingtoneTask_Completed;
     task.Show();
 }
        // Sample code for building a localized ApplicationBar
        //private void BuildLocalizedApplicationBar()
        //{
        //    // Set the page's ApplicationBar to a new instance of ApplicationBar.
        //    ApplicationBar = new ApplicationBar();

        //    // Create a new button and set the text value to the localized string from AppResources.
        //    ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative));
        //    appBarButton.Text = AppResources.AppBarButtonText;
        //    ApplicationBar.Buttons.Add(appBarButton);

        //    // Create a new menu item with the localized string from AppResources.
        //    ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText);
        //    ApplicationBar.MenuItems.Add(appBarMenuItem);
        //}

        private void SaveRingtoneButton_Click(object sender, EventArgs e)
        {
            SaveRingtoneTask task = new SaveRingtoneTask()
            {
                DisplayName = "ringtones in action",
                Source      = new Uri("appdata:/mytone.wma"),
                IsShareable = true,
            };

            task.Completed += saveRingtoneTask_Completed;
            task.Show();
        }
示例#8
0
        // Constructor
        public MainPage()
        {
            // Create a GameTimer to pump the XNA Framework.
            timer = new GameTimer();
            timer.UpdateInterval = TimeSpan.FromTicks(333333);
            timer.Update        += new EventHandler <GameTimerEventArgs>(timer_Update);

            // Start the timer, which calls FrameworkDispatcher.Update regularly
            timer.Start();

            // Initialize the SaveRingtoneTask and assign the Completed handler.
            saveRingtoneChooser            = new SaveRingtoneTask();
            saveRingtoneChooser.Completed += new EventHandler <TaskEventArgs>(saveRingtoneChooser_Completed);

            InitializeComponent();
        }
示例#9
0
 private void ExecuteSaveSoundAsRingtone(string soundPath)
 {
     if (IsDownloaded == false)
     {
         MessageBox.Show("Will not download until you short press atleast once to play sound");
         return;
     }
     App.Current.RootVisual.Dispatcher.BeginInvoke(() =>
     {
         SaveRingtoneTask task = new SaveRingtoneTask();
         task.Source           = new Uri("isostore:/" + this.SavePath);
         task.DisplayName      = this.Title;
         task.Show();
     }
                                                   );
 }
示例#10
0
        public edit_ringtone()
        {
            InitializeComponent();

            // Initialize the SaveRingtoneTask and assign the Completed handler in the page constructor.
            saveRingtoneChooser = new SaveRingtoneTask();
            saveRingtoneChooser.Completed += new EventHandler<TaskEventArgs>(MakeRingtone);

            StartRing = new TimeSpan(0, 0, 0);
            EndRing = new TimeSpan(0, 0, 39);

            LoadSong(App.ViewModel.SelectedSong);
            TextBox_SongTitle.Text = App.ViewModel.SelectedSong.SongTitleTrimmed;
            TextBlock_SongLength.Text = "0:00";
            TextBox_EndPosition.Text = "0:00";
            TextBox_StartPosition.Text = "0:00";
            Slider.MinimumRangeSpan = 1;
            //Slider.MaximumRangeSpan = 39;
            //media.Source = new Uri("isostore:/" + App.ViewModel.SelectedSong.SongTitle);
        }
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     customRingtone = new SaveRingtoneTask();
     customRingtone.Completed += new EventHandler<TaskEventArgs>(customRingtone_Completed);
 }
 private void btnringtone_Click(object sender, RoutedEventArgs e)
 {
     SaveRingtoneTask ringtonetask = new SaveRingtoneTask();
     ringtonetask.Source = new Uri("appdata:/Assets/Ring-BlackIce.wma");
     ringtonetask.DisplayName = "My custom ringtone";
     ringtonetask.Completed += (s, evt) =>
     {
         if (evt.TaskResult == TaskResult.OK)
             MessageBox.Show("Ringtone saved");
     };
     ringtonetask.Show();
 }
示例#13
0
        /// <summary>
        /// Save the ringtone
        /// </summary>
        /// <param name="songTitle"></param>
        /// <param name="fileName"></param>
        public void SaveRingtone(string songTitle, string fileName)
        {
            //The Save ringtone chooser
            SaveRingtoneTask saveRingtoneChooser = new SaveRingtoneTask();

            saveRingtoneChooser.Source = new Uri(string.Concat("isostore:/", fileName));
            saveRingtoneChooser.DisplayName = songTitle;
            saveRingtoneChooser.Show();
        }
示例#14
0
        private void mnuRingtone_Click(object sender, RoutedEventArgs e)
        {
            string fileName = ((MenuItem)sender).Tag.ToString();
            string fullName = "isostore:/Music/" + fileName;

            SaveRingtoneTask ringtoneTask = new SaveRingtoneTask();
            ringtoneTask.Source = new Uri(fullName);
            ringtoneTask.DisplayName = fileName;
            ringtoneTask.Show();
        }
示例#15
0
        private async void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            //Make sure the user is authenticated. If not go back to the main page
            if (Session.CurSession == null)
            {
                MessageBox.Show("Please sign in to continue.");
                NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
                return;
            }

            //Prevent the user from going back to the intro page
            NavigationService.RemoveBackEntry();

            //Get a reference to the App Bar buttons
            appBarMediaButton = (ApplicationBarIconButton)ApplicationBar.Buttons[0];
            appBarSaveButton = (ApplicationBarIconButton)ApplicationBar.Buttons[1];
            appBarShareButton = (ApplicationBarIconButton)ApplicationBar.Buttons[2];
            appBarSettingsButton = (ApplicationBarIconButton)ApplicationBar.Buttons[3];

            //Get a list of root elements from the user's One Drive and shared drive
            myFilesList = await FetchDirectory("me/skydrive/files");
            lstMyFiles.ItemsSource = myFilesList;
            sharedFilesList = await FetchDirectory("me/skydrive/shared");
            lstSharedFiles.ItemsSource = sharedFilesList;

            //Set the Save ringtone display
            saveRingtoneChooser = new SaveRingtoneTask();
            saveRingtoneChooser.Completed += saveRingtoneChooser_Completed;
        }
示例#16
0
 private void SetRingtone_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     if(_setRingtoneDown)
     {
         _setRingtoneDown = false;
         var saveRingtoneChooser = new SaveRingtoneTask();
         saveRingtoneChooser.Completed += saveRingtoneChooser_Completed;
         saveRingtoneChooser.Source = new Uri("appdata:" + Source.Source);
         saveRingtoneChooser.DisplayName = Source.Title;
         saveRingtoneChooser.Show();
     }
 }
示例#17
0
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     customRingtone            = new SaveRingtoneTask();
     customRingtone.Completed += new EventHandler <TaskEventArgs>(customRingtone_Completed);
 }