Ejemplo n.º 1
0
        private void finallyAddKeyPair(object sender, RoutedEventArgs e)
        {
            String keyName = newKeyName.Text;
            String value   = newKeyValue.Text;

            if (keyName.Length == 0)
            {
                MessageBox.Show("키 이름을 입력해주세요!", "키 데이터 생성 오류");
            }
            else if (value.Length == 0)
            {
                MessageBox.Show("키값을 입력해주세요!", "키 데이터 생성 오류");
            }
            else
            {
                AccountInfo accountInfo = datafile.getAccountInfo(ID_KEY);
                accountInfo.addKeyPair(keyName, value);
                datafile.setAccountInfo(accountInfo);

                fileManager.saveFile();
                this.DialogResult = true;
                this.Close();
                return;
            }
        }
Ejemplo n.º 2
0
        private void finallyModifyAccount(object sender, RoutedEventArgs e)
        {
            String newName = modifyAccountName.Text;

            if (newName.Length == 0)
            {
                MessageBox.Show("새 이름을 입력해주세요!", "계정 데이터 생성 오류");
            }
            else
            {
                datafile.modifyAccountTitle(itemID, newName);
                fileManager.saveFile();
                this.DialogResult = true;
                this.Close();
            }
            modifyAccountName.Text = "";
        }
Ejemplo n.º 3
0
        private void finallyAddAcount(object sender, RoutedEventArgs e)
        {
            String newName = newAccountName.Text;

            if (newName.Length == 0)
            {
                MessageBox.Show("이름을 입력해주세요!", "계정 데이터 생성 오류");
            }
            else
            {
                datafile.addAccountInfo(newName);
                fileManager.saveFile();
                this.DialogResult = true;
                this.Close();
            }
            newAccountName.Text = "";
        }
Ejemplo n.º 4
0
        private void finallyModifyKeyPair(object sender, RoutedEventArgs e)
        {
            String keyName = newKeyName.Text;
            String valName = newKeyValue.Text;

            if (keyName.Length == 0)
            {
                MessageBox.Show("키 이름이 비어있습니다!", "계정 데이터 생성 오류");
            }
            else if (valName.Length == 0)
            {
                MessageBox.Show("키 값이 없습니다!", "계정 데이터 생성 오류");
            }
            else
            {
                datafile.modifyKeyPair(encryptedAccountId, encryptedKeyPairId, keyName, valName);
                fileManager.saveFile();
                this.DialogResult = true;
                this.Close();
            }
        }
Ejemplo n.º 5
0
        private void ConfirmNewPassword_Click(object sender, RoutedEventArgs e)
        {
            String originalPassword = originalPasswordInput.Password;
            String newPassword      = newPasswordInput.Password;
            int    canTryLoginCode  = datafile.canTryLogin();

            if (canTryLoginCode == -1)
            {
                MessageBox.Show("최근에 로그인을 너무 많이 실패했습니다. " + datafile.getNextAvailableLoginText() + " 후에 시도하십시오.");
                return;
            }

            if (datafile.isCorrectPassword(originalPassword))
            {
                if (newPassword == originalPassword)
                {
                    MessageBox.Show("새로운 비밀번호가 기존 비밀번호와 일치합니다!", "비밀번호 재설정 오류");
                    return;
                }
                else
                {
                    //전부 통과
                    datafile.registerNewPassword(newPassword);
                    datafile.registerNewPasswordHint(newPasswordHintInput.Text);
                    fileManager.saveFile();
                    this.Hide();
                    MainWindow mainWindow = new MainWindow();
                    mainWindow.Show();
                    MessageBox.Show("새로운 비밀번호로 다시 로그인하시기 바랍니다.");
                }
            }
            else
            {
                MessageBox.Show("기존 비밀번호가 틀렸습니다. (시도 " + canTryLoginCode + "회 남음)");
            }
            originalPasswordInput.Password = "";
        }
Ejemplo n.º 6
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     fileManager.saveFile();
     Environment.Exit(0);
 }