private void BackButton_Click(object sender, RoutedEventArgs e) { this.Hide(); PlaylistWindow playlist = new PlaylistWindow(); playlist.Show(); }
private void CreatePlaylists_Click(object sender, RoutedEventArgs e) { if (PlaylistWindow.Show(this)) { StartActionType = StartActionType.CreatePlaylist; this.DialogResult = true; } }
static public void Delete_Execute(object parameter) { var newWin = new PlaylistWindow(); newWin.ShowDialog(); if (newWin.bHasReturned == true) { File.Delete(newWin.playlist.Path); } }
static public void Modify_Execute(object parameter) { var newWin = new PlaylistWindow(); newWin.ShowDialog(); if (newWin.bHasReturned == true) { #warning Doit ouvrir la fenetre "modifierPlaylist" } }
static public void Add_Execute(object parameter) { ViewModelPlayer context = parameter as ViewModelPlayer; var newWin = new PlaylistWindow(); newWin.ShowDialog(); if (newWin.bHasReturned == true) { string path = context._media.Source.ToString(); newWin.playlist.AddToPlaylist(path, false); } }
private void deletePlaylist_Click(object sender, RoutedEventArgs e) { var result = MessageBox.Show("Are you sure you want to delete this playlist ?", "Delete", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { _database.DeletePlaylist(UserGetSet.SelectedPlaylistId); this.Hide(); PlaylistWindow playlist = new PlaylistWindow(); playlist.Show(); } }
static public void Open_Execute(object parameter) { ViewModelPlayer context = parameter as ViewModelPlayer; var newWin = new PlaylistWindow(); newWin.ShowDialog(); if (newWin.bHasReturned == true) { context._playlist = newWin.playlist; if (context._playlist.Empty() == false) { context._media.Source = new Uri(context._playlist.Files[0].Path); } context._media.Play(); } }
private void ShowPlaylist() { var existing = Application.Current.Windows.OfType <PlaylistWindow>().FirstOrDefault(); if (existing == null || !existing.IsLoaded) { PlaylistWindow playlist = new PlaylistWindow(ViewModel.Playlist); playlist.Show(); } else { if (existing.WindowState == WindowState.Minimized) { existing.WindowState = WindowState.Normal; } existing.Activate(); existing.Focus(); } }
// Constructor // TODO: Shouldn't the ErrorDialog be able to be // associated with *any* window, not just the // PlaylistWindow? /// <summary> /// Create a new <see cref="ErrorDialog" />. /// </summary> /// <param name="playlist"> /// The <see cref="PlaylistWindow" /> which should be the /// parent of this window. /// </param> /// <param name="s1"> /// The <see cref="String" /> to be used as the primary text. /// </param> /// <param name="s2"> /// The <see cref="String" /> to be used as the secondary text. /// </param> public ErrorDialog(PlaylistWindow playlist, string s1, string s2) : this(s1, s2) { window.TransientFor = playlist; }
// Main /// <summary> /// The main method. /// </summary> /// <param name="args"> /// An array of <see cref="String">strings</see>, /// representing command-line arguments. /// </param> public static void Main(string [] args) { try { NDesk.DBus.BusG.Init(); } catch {} try { Global.SetProcessName("muine"); } catch {} Application.Init(); Gnome.Vfs.Vfs.Initialize(); // Try to find a running Muine try { dbus_object = DBusLib.Player.FindInstance(); } catch { } // Check if an instance of Muine is already running if (dbus_object != null) { // Handle command line args and exit. if (args.Length > 0) { ProcessCommandLine(args); } else { dbus_object.SetWindowVisible(true, 0); } Gdk.Global.NotifyStartupComplete(); return; } Catalog.Init("muine", Defines.GNOME_LOCALE_DIR); new Gnome.Program ("muine", Defines.VERSION, Gnome.Modules.UI, args); // Initialize D-Bus // We initialize here but don't connect to it until later. try { dbus_object = new DBusLib.Player(); DBusService.Instance.RegisterObject(dbus_object, "/org/gnome/Muine/Player"); } catch (Exception e) { Console.WriteLine(string_dbus_failed, e.Message); } // Init GConf Config.Init(); // Init files try { FileUtils.Init(); } catch (Exception e) { Error(e.Message); } // Register stock icons StockIcons.Initialize(); // Set default window icon SetDefaultWindowIcon(); // Open cover database try { cover_db = new CoverDatabase(3); } catch (Exception e) { Error(String.Format(string_coverdb_failed, e.Message)); } cover_db.DoneLoading += OnCoversDoneLoading; // Load song database try { db = new SongDatabase(6); } catch (Exception e) { Error(String.Format(string_songdb_failed, e.Message)); } db.Load(); // Setup Actions actions = new Actions(); // Create playlist window try { playlist = new PlaylistWindow(); } catch (PlayerException e) { Error(e.Message); } // D-Bus // Hook up D-Bus object before loading any songs into the // playlist, to make sure that the song change gets emitted // to the bus Muine.DBusLib.Player exported_dbus_object = dbus_object as Muine.DBusLib.Player; if (exported_dbus_object != null) { exported_dbus_object.HookUp(playlist); } // PluginManager // Initialize plug-ins (also before loading any songs, to make // sure that the song change gets through to all the plug-ins) new PluginManager(playlist); // Hook up multimedia keys if (!GnomeMMKeys.Initialize()) { new MmKeys(playlist); } // Process command line options bool opened_file = ProcessCommandLine(args); // Load playlist if (!opened_file) { playlist.RestorePlaylist(); } // Show UI playlist.Run(); while (MainContext.Pending()) { Gtk.Main.Iteration(); } // Load Covers cover_db.Load(); // Hook up to the session manager session_client = Gnome.Global.MasterClient(); session_client.Die += OnDieEvent; session_client.SaveYourself += OnSaveYourselfEvent; // Run! Application.Run(); }