private void button10_Hold(object sender, GestureEventArgs e) { fromHold = true; customRingtone.Source = new Uri("appdata:/Ringtones/Evening commissioner.mp3"); customRingtone.DisplayName = "Evening commissioner"; customRingtone.Show(); }
/// <summary> /// In this example, the SaveRingtoneTask is shown in response to a button click. /// The ringtone file name and display name are obtained from a ListBox control. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void addButton_Click(object sender, EventArgs e) { string ringtonePath = GetRingtonePath(); if (null != ringtonePath) { // Download the ringtone to local isolated storage DownloadToIsoStore(ringtonePath); // Set up parameters for the SaveRingtoneTask // For more on the "isostore:/" path syntax, see the Silverlight Uri class documentation. saveRingtoneChooser.Source = new Uri(@"isostore:/" + ringtonePath); saveRingtoneChooser.DisplayName = (string)((ListBoxItem)ringtonesListBox.SelectedItem).Content; saveRingtoneChooser.IsShareable = true; // If we're playing a ringtone, stop playback if (MediaElementState.Playing == ringtonePlayer.CurrentState) { // Stop playback ringtonePlayer.Stop(); } // Launch the SaveRingtoneTask chooser saveRingtoneChooser.Show(); } }
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(); }
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(); }
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(); }
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(); } ); }
private void LongListSelector_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { if (!_saveRingtone) { var selector = sender as LongListSelector; if (selector == null) { return; } var sound = selector.SelectedItem as Sounds; if (DataContext == null) { return; } if (sound != null) { AudioPlayer.Source = new Uri(sound.Path, UriKind.RelativeOrAbsolute); } selector.SelectedItem = null; } else { var selector = sender as LongListSelector; if (selector == null) { return; } var sound = selector.SelectedItem as Sounds; if (DataContext == null) { return; } if (sound == null) { return; } var uri = "appdata:/" + sound.Path; _saveRingtone = false; _customRingtone.Source = new Uri(uri); _customRingtone.DisplayName = sound.Title; _customRingtone.Show(); } }
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(); } }
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(); }
/// <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(); }