Exemplo n.º 1
0
 public static TrayiconMode Instance()
 {
     if (instance == null)
     {
         instance = new TrayiconMode();
     }
     return(instance);
 }
Exemplo n.º 2
0
 private void okButton_Click(object sender, RoutedEventArgs e)
 {
     if (Directory.Exists(this.pathTxtBox.Text))
     {
         conf.targetPath.set(this.pathTxtBox.Text);
         TrayiconMode.Instance();
         this.Hide();
     }
 }
Exemplo n.º 3
0
 public static TrayiconMode Instance()
 {
     if (instance == null)
     {
         instance = new TrayiconMode();
         instance.se.StartSync();
     }
     return(instance);
 }
Exemplo n.º 4
0
        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();
                }
            }
        }
Exemplo n.º 5
0
 public static TrayiconMode Instance()
 {
     if (instance == null)
     {
         instance = new TrayiconMode();
     }
     return instance;
 }