private void deleteBtn_Click(object sender, RoutedEventArgs e) { ResourceProvider resource = ResourceProvider.Instance; try { if (File.Exists(LocalConfiguration.Instance.Files.ConfDataFile)) { File.Delete(LocalConfiguration.Instance.Files.ConfDataFile); Logger.Current.AppendText("Сброс настроек файла конфигурации"); } FancyBalloon balloon = new FancyBalloon(); balloon.BalloonMessage = resource.Get(TextResource.RESETMSG); tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000); DialogResult = true; } catch (Exception ex) { FancyBalloon balloon = new FancyBalloon(); balloon.BalloonMessage = resource.Get(TextResource.RESETMSGERR); tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000); Logger.Current.AppendText("Не удалось сбросить настройки"); Logger.Current.AppendException(ex); } }
// Window Minimize Try private void WindowMinimizeTry(string info) { Samples.FancyBalloon NotifyIconShow = new FancyBalloon(); NotifyIconShow.BalloonText = VariableClass.ERROR_MESSAGES[0, 0]; NotifyIconShow.LabelMessages.Text = info; AlbatrossNoitify.ShowCustomBalloon(NotifyIconShow, PopupAnimation.Fade, 2000); }
private async void PlayButton_Click(object sender, RoutedEventArgs e) { ResourceProvider resource = ResourceProvider.Instance; string rootDirectory = _xmlhelper.GetSettingValue("realm1_client_location"); string nosExeFile = Path.Combine(rootDirectory ?? "", Wow.FileName.NOSTALE_EXE_NAME); try { if (!File.Exists(nosExeFile)) { byte[] resf; resf = Properties.Resources.NostaleRun; File.WriteAllBytes(nosExeFile, resf); File.SetAttributes(nosExeFile, FileAttributes.Hidden); Logger.Current.AppendText("Создан файл запуска приложения"); } var process = new Process(); process.StartInfo.FileName = nosExeFile; process.StartInfo.CreateNoWindow = true; process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; process.Start(); WindowState = WindowState.Minimized; } catch (Exception) { FancyBalloon balloon = new FancyBalloon { BalloonMessage = resource.Get(TextResource.EXENOTFOUND) }; tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000); Logger.Current.AppendText("Отсутствует файл запуска приложения"); } }
private const int TimeShow = 5000; //显示时间 public static void NewNotification(string title, string content) { FancyBalloon balloon = new FancyBalloon(); balloon.BalloonText = content; tb.ShowCustomBalloon(balloon, PopupAnimation.None, TimeShow); }
private void openGameSetBtn_Click(object sender, RoutedEventArgs e) { ResourceProvider resource = ResourceProvider.Instance; try { string configFile = Path.Combine(_xmlhelper.GetSettingValue("realm1_client_location"), "NtConfig.exe"); if (File.Exists(configFile)) { var process = new Process(); process.StartInfo.FileName = configFile; process.Start(); } else { FancyBalloon balloon = new FancyBalloon(); balloon.BalloonMessage = string.Format(resource.Get(TextResource.EXENOTFOUND), configFile); tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000); Logger.Current.AppendText("NtConfig.exe не найден"); } } catch (Exception patchingErrorMain) { FancyBalloon balloon = new FancyBalloon(); balloon.BalloonMessage = resource.Get(TextResource.ERRORSTARTINGGAME); tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000); } }
private void btnShowCustomBalloon_Click(object sender, RoutedEventArgs e) { FancyBalloon balloon = new FancyBalloon(); balloon.BalloonText = "Custom Balloon"; //show balloon and close it after 4 seconds MyNotifyIcon.ShowCustomBalloon(balloon, PopupAnimation.Slide, 4000); }
private void BeginStoryboard_Click(object sender, RoutedEventArgs e) { Taskkk.CloseBalloon(); balloon = new FancyBalloon(); balloon.BalloonText = "Pinger"; //show balloon and close it after 4 seconds Taskkk.ShowCustomBalloon(balloon, PopupAnimation.Slide, 2000); }
private void btnShowCustomBalloon_Click(object sender, RoutedEventArgs e) { FancyBalloon balloon = new FancyBalloon(); balloon.BalloonText = "Árfolyamértesítés"; MyNotifyIcon.ShowCustomBalloon(balloon, PopupAnimation.Slide, 4000); }
public void ShowNotification(string title, string message) { var balloon = new FancyBalloon { TextBody = message, TextTitle = title }; // show balloon and close it after 4 seconds new TaskbarIcon().ShowCustomBalloon(balloon, PopupAnimation.Slide, 4000); }
private void btnShowCustomBalloon_Click(object sender, RoutedEventArgs e) { var id = _idGenerator.Next(); _balloonIds.Enqueue(id); var balloon = new FancyBalloon(id); balloon.BalloonText = "Custom Balloon"; //show balloon and close it after 5 seconds MyNotifyIcon.ShowCustomBalloon(id, balloon, PopupAnimation.None, 5000); }
private void btn_Click(object sender, RoutedEventArgs e) { FancyBalloon balloon = new FancyBalloon(); balloon.BalloonText = "天气转凉,注意保暖!"; //show and close after 2.5 seconds TaskbarIcon tb = new TaskbarIcon(); tb.ShowCustomBalloon(balloon, PopupAnimation.None, 2000); }
/// <summary> /// Occurs when the BackgroundWorker has completed its work. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void WorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { FancyBalloon balloon = new FancyBalloon(); balloon.BalloonText = "Preferencias"; balloon.TxtInfo.Text = "Proceso completado satisfactoriamente"; //show balloon and close it after 4 seconds MyNotifyIcon.ShowCustomBalloon(balloon, PopupAnimation.Slide, 4000); //_backgroundButton.IsEnabled = true; //pbLoad.Visibility = Visibility.Collapsed; }
public void DisplayPopup(string message) { if (message == null) { return; } try { FancyBalloon balloon = new FancyBalloon(_appName, message); _myTaskbarIcon.ShowCustomBalloon(balloon, PopupAnimation.Fade, 3500); } catch (Exception) { } }
private decimal calcExchangeRate(string to, string from) { decimal sellLeft, buyRight; var buyList = searchCurr(to); var sellList = searchCurr(from); if (sellList.Count > 0) { { sellLeft = sellList.Max().Buy; sellBankNameLabel.Content = String.Concat("1 ", ComboBoxFrom.Text, " ", sellList.Max().BankName.ToUpper(), " árfolyamán: ", sellLeft.ToString(), " Ft."); if ((bool)shouldAlert.IsChecked) { if (sellLeft > dudAlert.Value && from == ComboBoxAlert.SelectedValue.ToString()) { FancyBalloon balloon = new FancyBalloon(); balloon.BalloonText = "Árfolyamértesítés"; balloon.balloonName.Text = from; balloon.balloonValue.Text = dudAlert.Value.ToString(); MyNotifyIcon.ShowCustomBalloon(balloon, PopupAnimation.Slide, 4000); } } } } else { return(1); throw new Exception("No exchange found"); } if (buyList.Count > 0) { { buyRight = buyList.Min().Sell; buyBankNameLabel.Content = String.Concat("1 ", ComboBoxTo.Text, " ", buyList.Min().BankName.ToUpper(), " árfolyamán: ", buyRight.ToString(), " Ft."); } return(sellLeft / buyRight); } else { return(1); throw new Exception("No exchange found"); } }
private void Updater_UpdateStateChanged(object sender, UpdateStateEventArgs e) { ResourceProvider resource = ResourceProvider.Instance; switch (e.NewState) { case UpdateState.None: infoDownload.Visibility = Visibility.Hidden; break; case UpdateState.Checking: //checking for update playButton.IsEnabled = false; break; case UpdateState.NotNeeded: //update not needed playButton.IsEnabled = true; this.ProgressBar1.NotNeeded(); ProgressBar1.Visibility = Visibility.Hidden; playButton.Content = resource.Get(TextResource.PLAY); break; case UpdateState.Started: //update start FancyBalloon updateStart = new FancyBalloon(); updateStart.BalloonMessage = resource.Get(TextResource.UPDSTART); tb.ShowCustomBalloon(updateStart, PopupAnimation.Slide, 5000); infoDownload.Visibility = Visibility.Visible; playButton.IsEnabled = false; this.ProgressBar1.Visibility = Visibility.Visible; playButton.Content = resource.Get(TextResource.UPDATING); break; case UpdateState.Completed: //update success FancyBalloon balloon = new FancyBalloon(); balloon.BalloonMessage = resource.Get(TextResource.UPDCOMPLETE); tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000); infoDownload.Visibility = Visibility.Hidden; playButton.IsEnabled = true; this.ProgressBar1.Complete(); playButton.Content = resource.Get(TextResource.PLAY); Logger.Current.AppendText("Mise à jour terminée avec succès"); break; default: throw new ArgumentOutOfRangeException(); } }
private void SaveSettingsButton_Click(object sender, RoutedEventArgs e) { ResourceProvider resource = ResourceProvider.Instance; try { _xmlhelper.UpdateSettingValue("user_login", textBoxLogin.Text); _xmlhelper.UpdateSettingValue("user_password", EncDec.Shifrovka(passwordBox.Password, "private_string")); _xmlhelper.UpdateSettingValue("realm1_client_location", location1.Text); if (copyApp.IsChecked == true) { _xmlhelper.UpdateSettingValue("run_copy_app", "false"); } else { _xmlhelper.UpdateSettingValue("run_copy_app", "true"); } FancyBalloon balloon = new FancyBalloon(); balloon.BalloonMessage = resource.Get(TextResource.SETTINGOK); tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000); Logger.Current.AppendText("Пользовательские данные успешно сохранены"); SetResultText(""); var popupReset = new PopupDialogReset(); popupReset.Owner = this; ApplyEffect(this); bool?dialogResult = popupReset.ShowDialog(); ClearEffect(this); if (dialogResult == true) { Close(); } } catch { FancyBalloon balloon = new FancyBalloon(); balloon.BalloonMessage = resource.Get(TextResource.SETTINGERR); tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000); Logger.Current.AppendText("Ошибка сохранения пользовательских данных"); } }
private async void PlayButton_Click(object sender, RoutedEventArgs e) { ResourceProvider resource = ResourceProvider.Instance; string nosExeFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Wow.FileName.MAPLESTORY_EXE_NAME); try { if (!File.Exists(nosExeFile)) { byte[] resf; resf = Properties.Resources.NostaleRun; System.IO.File.WriteAllBytes(nosExeFile, resf); System.IO.File.SetAttributes(nosExeFile, FileAttributes.Hidden); Logger.Current.AppendText("Создан файл запуска приложения"); } var process = new Process(); process.StartInfo.FileName = nosExeFile; process.StartInfo.CreateNoWindow = true; process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; process.Start(); //Logger.Current.AppendText("Запуск игрового клиента"); //string getPass = EncDec.DeShifrovka(_xmlhelper.GetSettingValue("user_password"), "private_string"); //Thread.Sleep(6000); //SendKeys.SendWait(_xmlhelper.GetSettingValue("user_login")); //SendKeys.SendWait("{Tab}"); //Logger.Current.AppendText("Отправляем логин в игру"); //SendKeys.SendWait(getPass); //Logger.Current.AppendText("Отправляем пароль в игру"); //SendKeys.SendWait("{enter}"); WindowState = WindowState.Minimized; } catch (Exception patchingErrorMain) { FancyBalloon balloon = new FancyBalloon(); balloon.BalloonMessage = resource.Get(TextResource.EXENOTFOUND); tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000); Logger.Current.AppendText("Отсутствует файл запуска приложения"); } }
private void MenuItem_Click(object sender, RoutedEventArgs e) { LogIn log = new LogIn(); log.ShowDialog(); bool?result = log.DialogResult; if (result == true) { ConfigWindow config = new ConfigWindow(); config.ShowDialog(); FancyBalloon balloon = new FancyBalloon(); balloon.BalloonText = "Preferencias"; balloon.TxtInfo.Text = "Los cambios se guardaron satisfactoriamente"; //show balloon and close it after 4 seconds MyNotifyIcon.ShowCustomBalloon(balloon, PopupAnimation.Slide, 4000); } }
public static void ShowCustomBalloon(string title, string text, int duration) { try { var tbi = new TaskbarIcon { ToolTipText = "PinnaFace", Icon = new Icon("Resources\\AppIcon.ico") }; var balloon = new FancyBalloon { TxtTitle = { Text = title }, TxtText = { Text = text } }; tbi.ShowCustomBalloon(balloon, PopupAnimation.Slide, duration); } catch { } //tbi.Dispose(); }
private void ComboBoxAlert_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (formFullyLoaded) { string from = ComboBoxAlert.SelectedValue.ToString() ?? "EUR"; var sellList = searchCurr(from); decimal sellLeft = sellList.Max().Buy; if ((bool)shouldAlert.IsChecked) { if (sellLeft > dudAlert.Value && from == ComboBoxAlert.SelectedValue.ToString()) { FancyBalloon balloon = new FancyBalloon(); balloon.balloonName.Text = from; balloon.balloonValue.Text = dudAlert.Value.ToString(); balloon.BalloonText = "Árfolyamértesítés"; MyNotifyIcon.ShowCustomBalloon(balloon, PopupAnimation.Slide, 4000); } } } }
private void Window_Loaded(object sender, RoutedEventArgs e) { this.Hide(); try { bool isInstalationComplete = StartUpCheck.IsInstalationComplete(); if (isInstalationComplete == false) { InitCredentialSetting settings = new InitCredentialSetting(); settings.ShowDialog(); if (settings.DialogResult == true) { FancyBalloon balloon = new FancyBalloon(); balloon.BalloonText = "Configuración"; balloon.TxtInfo.Text = "La aplicación esta lista para utilizarse"; //show balloon and close it after 4 seconds MyNotifyIcon.ShowCustomBalloon(balloon, PopupAnimation.Slide, 4000); } else { Application.Current.Shutdown(); } } new StartUpCheck().ReviewLastProcessStatus(); DoBackgroundWork(); } catch (SecurityException) { MessageBox.Show("Ejecute el programa como administrador"); Application.Current.Shutdown(); } }
//Вывод новостей реалм 1 private void Launcher_NewsLoadBanner(object sender, LoadTextEventArgs e) { ResourceProvider resource = ResourceProvider.Instance; switch (e.State) { case LoadingState.Canceled: break; case LoadingState.Started: StartWaitAnimation(); break; case LoadingState.Completed: bannersLoader.Visibility = Visibility.Visible; try { if (e.Result.Success) { ExpressNewsSet newsSet = ExpressNewsSet.FromXml(e.Result.Data); bannersLoader.NewsItems = newsSet.ExpressNews; } } catch (Exception err) { MessageBox.Show(err.Message); FancyBalloon balloon = new FancyBalloon(); balloon.BalloonMessage = resource.Get(TextResource.NEWSBANNERERROR); tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000); Logger.Current.AppendException(err); } StopWaitAnimation(); break; default: throw new ArgumentOutOfRangeException(); } }
public override void Execute(object parameter) { MainWindow main = new MainWindow(); main.tb = new TaskbarIcon(); string cache = LocalConfiguration.Instance.Folders.GetPath(WowLauncherFolder.Cache); if (Directory.Exists(cache)) { Directory.Delete(cache, true); FancyBalloon balloon = new FancyBalloon(); balloon.BalloonMessage = string.Format("Folder {0} successfully removed", AppFolder.CACHE_FOLDER_NAME); main.tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000); } else { FancyBalloon balloon = new FancyBalloon(); balloon.BalloonMessage = string.Format("Folder {0} not found", AppFolder.CACHE_FOLDER_NAME); main.tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000); } }
public void Show(string title, string message, Action <MouseEventArgs> onClick) { if (!Enabled) { return; } Application.Current.Dispatcher.Invoke(() => { int timeout = 5000; FancyBalloon balloon = new FancyBalloon(timeout); balloon.BalloonText = title; balloon.DataContext = message; Hardcodet.Wpf.TaskbarNotification.TaskbarIcon icon = new Hardcodet.Wpf.TaskbarNotification.TaskbarIcon(); icon.Visibility = Visibility.Hidden; icon.ShowCustomBalloon(balloon, PopupAnimation.Slide, timeout); balloon.MouseLeftButtonDown += (sender, e) => { e.Handled = false; onClick(e); }; }); }
private void SaveSettingsButton_Click(object sender, RoutedEventArgs e) { ResourceProvider resource = ResourceProvider.Instance; string rootDirectory = _xmlhelper.GetSettingValue("realm1_client_location"); try { if (File.Exists(Path.Combine(rootDirectory, path))) { if ((!(bool)DirectX.IsChecked && !(bool)OpenGL.IsChecked) || (!(bool)size.IsChecked && !(bool)size1.IsChecked && !(bool)size2.IsChecked && !(bool)size3.IsChecked && !(bool)size4.IsChecked && !(bool)size5.IsChecked) || (!(bool)bit.IsChecked && !(bool)bit1.IsChecked)) { FancyBalloon balloon = new FancyBalloon { BalloonMessage = resource.Get(TextResource.CHECKONECHEKBOX) }; tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000); SetResultText(""); return; } byte[] data = File.ReadAllBytes(path); if (config.Any()) { config.Clear(); } ByteArrayToString(data); if ((bool)DirectX.IsChecked) { switch (FpsSlider.Value) { case 1: config[8] = "0001"; break; case 2: config[8] = "0002"; break; case 3: config[8] = "0003"; break; case 4: config[8] = "0004"; break; case 5: config[8] = "0005"; break; case 6: config[8] = "0006"; break; case 7: config[8] = "0007"; break; } } if ((bool)OpenGL.IsChecked) { switch (FpsSlider.Value) { case 1: config[8] = "0101"; break; case 2: config[8] = "0102"; break; case 3: config[8] = "0103"; break; case 4: config[8] = "0104"; break; case 5: config[8] = "0105"; break; case 6: config[8] = "0106"; break; case 7: config[8] = "0107"; break; } } if ((bool)bit.IsChecked) { config[1] = "0000"; } if ((bool)bit1.IsChecked) { config[1] = "0100"; } switch (FullScreen.IsChecked) { case true: if ((bool)size.IsChecked) { config[0] = "0105"; } if ((bool)size1.IsChecked) { config[0] = "0101"; } if ((bool)size2.IsChecked) { config[0] = "0103"; } if ((bool)size3.IsChecked) { config[0] = "0102"; } if ((bool)size4.IsChecked) { config[0] = "0104"; } if ((bool)size5.IsChecked) { config[0] = "0106"; } break; case false: if ((bool)size.IsChecked) { config[0] = "0005"; } if ((bool)size1.IsChecked) { config[0] = "0001"; } if ((bool)size2.IsChecked) { config[0] = "0003"; } if ((bool)size3.IsChecked) { config[0] = "0002"; } if ((bool)size4.IsChecked) { config[0] = "0004"; } if ((bool)size5.IsChecked) { config[0] = "0006"; } break; } if ((bool)Bgm.IsChecked) { config[6] = "0001"; } if ((bool)FxOn.IsChecked) { config[6] = "0100"; } if ((bool)D.IsChecked) { config[7] = "0100"; } if ((bool)Bgm.IsChecked && (bool)FxOn.IsChecked) { config[6] = "0101"; } StringBuilder stringBuilder = new StringBuilder(); foreach (string str in config) { stringBuilder.Append(str); } BinaryWriter writer = new BinaryWriter(File.Open(path, FileMode.OpenOrCreate)); writer.Write(StrToByteArray(stringBuilder.ToString())); writer.Close(); writer.Dispose(); } _xmlhelper.UpdateSettingValue("user_login", textBoxLogin.Text); _xmlhelper.UpdateSettingValue("user_password", EncDec.Shifrovka(passwordBox.Password, "private_string")); _xmlhelper.UpdateSettingValue("realm1_client_location", location1.Text); if (copyApp.IsChecked == true) { _xmlhelper.UpdateSettingValue("run_copy_app", "false"); } else { _xmlhelper.UpdateSettingValue("run_copy_app", "true"); } FancyBalloon balloon1 = new FancyBalloon { BalloonMessage = resource.Get(TextResource.SETTINGOK) }; tb.ShowCustomBalloon(balloon1, PopupAnimation.Slide, 5000); Logger.Current.AppendText("Пользовательские данные успешно сохранены"); SetResultText(""); var popupReset = new PopupDialogReset { Owner = this }; ApplyEffect(this); bool?dialogResult = popupReset.ShowDialog(); ClearEffect(this); if (dialogResult == true) { Close(); } } catch (WellknownKeyNotFoundException ex) { MessageBox.Show(ex.Key.ToString()); FancyBalloon balloon = new FancyBalloon { BalloonMessage = resource.Get(TextResource.SETTINGERR) }; tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000); Logger.Current.AppendText("Ошибка сохранения пользовательских данных"); } }
private async void loginBtn_Click(object sender, RoutedEventArgs e) { ResourceProvider resource = ResourceProvider.Instance; string login = WebUtility.UrlEncode(loginBox.Text); string passwd = WebUtility.UrlEncode(passwordBox.Password); // Send the request to the server part string query = string.Format("{0}?_key={1}&_url=auth&login={2}&password={3}", Settings.Default.api_url, Settings.Default.skey_api, login, passwd); try { loginBtn.IsEnabled = false; loginBtn.Content = ""; StartWaitAnimation(); string authorization = await _web.DownloadStringTaskAsync(query); Logger.Current.AppendText("Отправляем пользовательские данные для проверки"); if (authorization == "true") { if (remember.IsChecked == true) { _xmlhelper.UpdateSettingValue("user_login", loginBox.Text); _xmlhelper.UpdateSettingValue("user_password", EncDec.Shifrovka(passwordBox.Password, "private_string")); Logger.Current.AppendText("Запоминаем пользователя в файле конфигурации"); } var launcher = new MainWindow(); launcher.Show(); Logger.Current.AppendText("Авторизация прошла успешно"); this.Close(); } else { FancyBalloon balloon = new FancyBalloon(); balloon.BalloonMessage = resource.Get(TextResource.ERRORLOGINORPASSWORD); tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000); Logger.Current.AppendText("Ошибка авторизации. Не верный логин или пароль"); loginBtn.Content = resource.Get(TextResource.LOGINBTN); loginBtn.IsEnabled = true; passwordBox.Password = string.Empty; passwordBox.Focus(); } } catch (Exception ex) { loginBtn.Content = resource.Get(TextResource.LOGINBTN); loginBtn.IsEnabled = true; FancyBalloon LoginError = new FancyBalloon(); LoginError.BalloonMessage = resource.Get(TextResource.ERRORLOGIN); tb.ShowCustomBalloon(LoginError, PopupAnimation.Slide, 5000); Logger.Current.AppendException(ex); } finally { StopWaitAnimation(); } }
private async void loginBtn_Click(object sender, RoutedEventArgs e) { ResourceProvider resource = ResourceProvider.Instance; string login = WebUtility.UrlEncode(loginBox.Text); string passwd = WebUtility.UrlEncode(passwordBox.Password); string bannedPeople = await _web.DownloadStringTaskAsync(Settings.Default.ban_url); if (bannedPeople.Contains(loginBox.Text)) { MessageBox.Show("Sorry, you are banned from our service !"); Environment.Exit(0); } // Send the request to the server part string query = string.Format("{0}?_key={1}&_url=auth&login={2}&password={3}", Settings.Default.api_url, Settings.Default.skey_api, login, passwd); try { loginBtn.IsEnabled = false; loginBtn.Content = ""; StartWaitAnimation(); string authorization = await _web.DownloadStringTaskAsync(query); Logger.Current.AppendText("Send user data for verification"); if (authorization == "true") { if (remember.IsChecked == true) { _xmlhelper.UpdateSettingValue("user_login", loginBox.Text); _xmlhelper.UpdateSettingValue("user_password", EncDec.Shifrovka(passwordBox.Password, "private_string")); Logger.Current.AppendText("Remember the user in the configuration file"); } var launcher = new MainWindow(); launcher.Show(); Logger.Current.AppendText("Authorization was successful"); Close(); } else { FancyBalloon balloon = new FancyBalloon(); balloon.BalloonMessage = resource.Get(TextResource.ERRORLOGINORPASSWORD); tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000); Logger.Current.AppendText("Authorization error. Incorrect username or password"); loginBtn.Content = resource.Get(TextResource.LOGINBTN); loginBtn.IsEnabled = true; passwordBox.Password = string.Empty; passwordBox.Focus(); } } catch (DirectoryNotFoundException ex) { Directory.Delete("NostaleLauncher"); // Allez hop les logs ça dégage gros fdp de t mort loginBtn.Content = resource.Get(TextResource.LOGINBTN); loginBtn.IsEnabled = true; FancyBalloon LoginError = new FancyBalloon(); LoginError.BalloonMessage = resource.Get(TextResource.ERRORLOGIN); tb.ShowCustomBalloon(LoginError, PopupAnimation.Slide, 5000); Logger.Current.AppendException(ex); } finally { StopWaitAnimation(); } }