Exemple #1
0
        private void StartConnection()
        {
            bool answear = connector.ConnectToServer();

            if (answear)
            {
                myClient = connector.GetClient;
                myClient.GenrePropertyChanged         += MyClient_GenrePropertyChanged;
                myClient.ProducerPropertyChanged      += MyClient_ProducerPropertyChanged;
                myClient.AllMusicPropertyChanged      += MyClient_AllMusicPropertyChanged;
                myClient.AllMusicCountPropertyChanged += MyClient_AllMusicCountPropertyChanged;


                myClient.MyMusicCountPropertyChanged += MyClient_MyMusicCountPropertyChanged;
                myClient.MyMusicPropertyChanged      += MyClient_MyMusicPropertyChanged;
                myClient.UpdateCountPropertyChanged  += MyClient_UpdateCountPropertyChanged;
                myClient.MyAlbumPropertyChanged      += MyClient_MyAlbumPropertyChanged;

                myClient.CompanyPropertyChanged += MyClient_CompanyPropertyChanged;
            }
            else
            {
                MessageBoxResult result = MessageBox.Show("Try connect one more?", "Music Player", MessageBoxButton.YesNo, MessageBoxImage.Exclamation);
                if (result == MessageBoxResult.Yes)
                {
                    StartConnection();
                }
                else
                {
                    Application.Current.MainWindow.Close();
                }
            }
        }
 public DBConnector(UserPlayer user)
 {
     this.user = user;
     client    = new ClientApp();
 }