The position of some variables has been changed to avoid some bugs

This commit is contained in:
Alexander 2019-10-15 20:19:06 +03:00
parent c14f525569
commit 2548674b26

View file

@ -273,13 +273,13 @@ private void DeleteUpdateFiles()
private void SaveConfirm()
{
string messageBoxText;
if (richTextBox.Modified)
{
if (string.IsNullOrEmpty(PublicVar.openFileName))
{
PublicVar.openFileName = "Unnamed.cnp";
}
string messageBoxText;
if (!PublicVar.keyChanged)
{
messageBoxText = "Save file: " + "\"" + PublicVar.openFileName + "\"" + " ? ";
@ -453,11 +453,11 @@ private void LockFile()
string opnfile = File.ReadAllText(filePath);
string de = AES.Decrypt(opnfile, TypedPassword.Value, null, settings.HashAlgorithm, Convert.ToInt32(settings.PasswordIterations), Convert.ToInt32(settings.KeySize));
fileLockedPanel.Visible = false;
richTextBox.Focus();
richTextBox.Text = de;
richTextBox.SelectionStart = caretPos;
PublicVar.encryptionKey.Set(TypedPassword.Value);
TypedPassword.Value = null;
richTextBox.Focus();
}
catch (Exception ex)
{