/*
         * /// <summary>
         * /// The txt password_ password changed.
         * /// </summary>
         * /// <param name="sender">
         * /// The sending control.
         * /// </param>
         * /// <param name="e">
         * /// The eventarguments.
         * /// </param>
         * private void TxtPassword_PasswordChanged(object sender, RoutedEventArgs e)
         * {
         * }
         */

        /// <summary>
        /// The bt test connection_ click.
        /// </summary>
        /// <param name="sender">
        /// The sending control.
        /// </param>
        /// <param name="e">
        /// The eventarguments.
        /// </param>
        private void BtTestConnection_Click(object sender, RoutedEventArgs e)
        {
            bool successfull = LibraryManagement.CanLoginSuccessfully(TxtServer.Text, TxtUsername.Text, TxtPassword.Text);

            if (successfull)
            {
                new ModernDialog()
                {
                    Content = LanguageOutput.Notice.ConnectionSuccessfull,
                }
            }
Beispiel #2
0
        /// <summary>
        /// The test login.
        /// </summary>
        private void DoLogin()
        {
            var login = new Thread(() =>
            {
                bool success = LibraryManagement.CanLoginSuccessfully(Properties.Settings.Default.server,
                                                                      Properties.Settings.Default.username, Properties.Settings.Default.password);
                if (success)
                {
                    GetArtists();
                    GetArtistCovers();
                    Application.Current.Dispatcher.Invoke(
                        DispatcherPriority.Normal,
                        (ThreadStart) delegate
                    {
                        Constants.LoggedIn = true;
                        LibraryManagement.GetFolder();
                        BuildNavigation();
                        Constants.WindowMain.ContentSource = new Uri("/Content/Home/AlbumPage.xaml?type=all", UriKind.Relative);
                    });
                }
                else
                {
                    Application.Current.Dispatcher.Invoke(
                        DispatcherPriority.Normal,
                        (ThreadStart) delegate
                    {
                        new ModernDialog
                        {
                            Content = LanguageOutput.Errors.LoginFailedLong,
                            Title   = LanguageOutput.Errors.LoginFailedShort,
                        }.ShowDialog();
                        BuildNavigation();
                        Constants.WindowMain.ContentSource = new Uri("/Pages/Settings.xaml", UriKind.Relative);
                    });
                }
            });

            login.SetApartmentState(ApartmentState.STA);
            login.Start();
        }