public static TrayiconMode Instance() { if (instance == null) { instance = new TrayiconMode(); } return(instance); }
private void okButton_Click(object sender, RoutedEventArgs e) { if (Directory.Exists(this.pathTxtBox.Text)) { conf.targetPath.set(this.pathTxtBox.Text); TrayiconMode.Instance(); this.Hide(); } }
public static TrayiconMode Instance() { if (instance == null) { instance = new TrayiconMode(); instance.se.StartSync(); } return(instance); }
private async void Button_Click(object sender, RoutedEventArgs e) { string username = this.usernameTxtBox.Text; string password = this.paswordTxtBox.Password; if (username.Equals("")) { UsefullMethods.setLabelAlert("danger", this.errorBox, "Missing username! Username field cannot be empty."); return; } if (password.Equals("")) { UsefullMethods.setLabelAlert("danger", this.errorBox, "Missing password! Password field cannot be empty."); return; } string token; BackupServiceClient server = null; try { if (Const <BackupServiceClient> .Instance().get() == null) { server = logIn(username, password, out token); } } catch (LoginExcpetion ex) { UsefullMethods.setLabelAlert("danger", this.errorBox, ex.Message); } if (server != null) { Const <BackupServiceClient> .Instance().set(server); UsefullMethods.setLabelAlert("success", this.errorBox, "Log in succeed!"); conf.userName.set(this.usernameTxtBox.Text); await Task.Delay(500); this.Hide(); string targetPath = conf.targetPath.get(); // if the path is not setted a windows for selecting the path must be shown if (targetPath == null) { WelcomeWindows ww = new WelcomeWindows(); ww.parent = this; ww.Show(); ww.Activate(); } else { TrayiconMode.Instance(); } } }
public static TrayiconMode Instance() { if (instance == null) { instance = new TrayiconMode(); } return instance; }