BlockStudio.Dialogs.FrmAccountProperties.Finished C# (CSharp) Method

Finished() private method

private Finished ( ) : void
return void
        private void Finished()
        {
            var password = txtPassword.Text;
            if (string.IsNullOrEmpty(password))
            {
                MessageBoxEx.Show(this, "Password cannot be blank", "Block Studio", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            txtPassword.Enabled = false;
            btnOK.Enabled = false;
            btnCancel.Enabled = false;
            chbSavePassword.Enabled = false;

            if (Account==null)
            {
                Account = new Account();
                Account.Address = Connection.EthereumService.NewAccount(password);
            }

            Account.Password = password;
            Account.Label = txtLabel.Text;

            BlockStudioProjectService.BlockStudioProject.UpsertAccount(Account);
            BlockStudioProjectService.BlockStudioProject.SaveToDisk();

            this.Close();
        }