/// <summary> /// Instancie MainWindow /// </summary> public MainWindow() { AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler); UserDBFront.LoadUsers(); PlaylistFront.LoadMusics(); PlayerFront.LoadPlayer(); InitializeComponent(); ToTaskBar.DoubleClick += delegate(object sender, EventArgs args) { Show(); WindowState = WindowState.Normal; }; Settings.Default.Upgrade(); if (Settings.Default.StayLogged) { try { LogIn(UserDBFront.MyUserDB.Database.First(x => x.Address.Equals(Settings.Default.LastMail))); } catch { Settings.Default.StayLogged = false; } } Panel.DataContext = PlayerFront.MyPlayer; MyScroller.DataContext = PlaylistFront.AllMusics; }
/// <summary> /// Lance les méthodes suivantes lorsque l'appli est fermée /// </summary> /// <param name="sender"> Object envoyeur </param> /// <param name="e"> Évènement déclenché par la vue </param> private void OnClose(object sender, EventArgs e) { MyPlayer.Detail.MyWorker.CancelAsync(); UserDBFront.SaveUsers(); PlaylistFront.SaveMusics(); Settings.Default.Save(); Settings.Default.Reload(); ToTaskBar.Dispose(); }
static void Main(string[] args) { /* ----- MAKER ----- */ //Load Music DB PlaylistFront.LoadMusics(); //Load Music DB PlayerFront.LoadPlayer(); //Load User DB UserDBFront.LoadUsers(); /* ----- MAKER ----- */ /* ----- DISPLAY ----- */ //Display a User WriteLine(UserDBFront.MyUserDB.Database.ElementAt(0)); //Display a Music WriteLine(PlaylistFront.AllMusics.PlaylistProperty.ElementAt(0)); //Display a playlist WriteLine(PlaylistFront.AllMusics); //Display a comment WriteLine(PlaylistFront.AllMusics.PlaylistProperty.ElementAt(0)); /* ----- DISPLAY ----- */ /* ----- USING ----- */ PlayerFront.MyPlayer.CurrentUser = UserDBFront.MyUserDB.Database.ElementAt(0); PlayerFront.MyPlayer.Play(PlaylistFront.AllMusics.PlaylistProperty.ElementAt(0)); Thread.Sleep(10000); PlayerFront.MyPlayer.GoToNextOrPrevious(1); Thread.Sleep(10000); PlayerFront.MyPlayer.GoToNextOrPrevious(-1); Thread.Sleep(10000); /* ----- USING ----- */ }