mirror of
https://github.com/Crypto-Notepad/Crypto-Notepad.git
synced 2026-03-11 08:55:25 +00:00
Source code was simplified
This commit is contained in:
parent
659f2c4184
commit
16a07484b9
1 changed files with 10 additions and 21 deletions
|
|
@ -98,9 +98,7 @@ private async Task DecryptAES()
|
||||||
richTextBox.Text = await AES.Decrypt(openedFileText, TypedPassword.Value, null, settings.HashAlgorithm,
|
richTextBox.Text = await AES.Decrypt(openedFileText, TypedPassword.Value, null, settings.HashAlgorithm,
|
||||||
Convert.ToInt32(settings.PasswordIterations), Convert.ToInt32(settings.KeySize)); ;
|
Convert.ToInt32(settings.PasswordIterations), Convert.ToInt32(settings.KeySize)); ;
|
||||||
}
|
}
|
||||||
|
Text = Path.GetFileName(openFileDialog.FileName) + " – " + PublicVar.appName;
|
||||||
string NameWithotPath = Path.GetFileName(openFileDialog.FileName);
|
|
||||||
Text = NameWithotPath + " – " + PublicVar.appName;
|
|
||||||
filePath = openFileDialog.FileName;
|
filePath = openFileDialog.FileName;
|
||||||
PublicVar.openFileName = Path.GetFileName(openFileDialog.FileName);
|
PublicVar.openFileName = Path.GetFileName(openFileDialog.FileName);
|
||||||
PublicVar.encryptionKey.Set(TypedPassword.Value);
|
PublicVar.encryptionKey.Set(TypedPassword.Value);
|
||||||
|
|
@ -163,11 +161,9 @@ private async void OpenAsotiations()
|
||||||
MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
||||||
if (res == DialogResult.No)
|
if (res == DialogResult.No)
|
||||||
{
|
{
|
||||||
string opnfile = File.ReadAllText(args[1]);
|
richTextBox.Text = File.ReadAllText(args[1]); ;
|
||||||
string NameWithotPath = Path.GetFileName(args[1]);
|
|
||||||
richTextBox.Text = opnfile;
|
|
||||||
filePath = args[1];
|
filePath = args[1];
|
||||||
Text = NameWithotPath + " – " + PublicVar.appName;
|
Text = Path.GetFileName(args[1]) + " – " + PublicVar.appName;
|
||||||
StatusPanelFileInfo();
|
StatusPanelFileInfo();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -191,11 +187,9 @@ private async void SendTo()
|
||||||
MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
||||||
if (res == DialogResult.No)
|
if (res == DialogResult.No)
|
||||||
{
|
{
|
||||||
string opnfile = File.ReadAllText(argsPath);
|
richTextBox.Text = File.ReadAllText(argsPath);
|
||||||
string NameWithotPath = Path.GetFileName(argsPath);
|
|
||||||
richTextBox.Text = opnfile;
|
|
||||||
filePath = argsPath;
|
filePath = argsPath;
|
||||||
Text = NameWithotPath + " – " + PublicVar.appName;
|
Text = Path.GetFileName(argsPath) + " – " + PublicVar.appName;
|
||||||
StatusPanelFileInfo();
|
StatusPanelFileInfo();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -948,10 +942,8 @@ private async void RichTextBox_DragDrop(object sender, DragEventArgs e)
|
||||||
MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
||||||
if (res == DialogResult.No)
|
if (res == DialogResult.No)
|
||||||
{
|
{
|
||||||
string opnfile = File.ReadAllText(openFileDialog.FileName);
|
richTextBox.Text = File.ReadAllText(openFileDialog.FileName);
|
||||||
string NameWithotPath = Path.GetFileName(openFileDialog.FileName);
|
Text = Path.GetFileName(openFileDialog.FileName) + " – " + PublicVar.appName;
|
||||||
richTextBox.Text = opnfile;
|
|
||||||
Text = NameWithotPath + " – " + PublicVar.appName;
|
|
||||||
filePath = openFileDialog.FileName;
|
filePath = openFileDialog.FileName;
|
||||||
StatusPanelFileInfo();
|
StatusPanelFileInfo();
|
||||||
return;
|
return;
|
||||||
|
|
@ -1065,8 +1057,7 @@ private void NewMainMenu_Click(object sender, EventArgs e)
|
||||||
saveFileDialog.FileName = "Unnamed.cnp";
|
saveFileDialog.FileName = "Unnamed.cnp";
|
||||||
PublicVar.encryptionKey.Set(TypedPassword.Value);
|
PublicVar.encryptionKey.Set(TypedPassword.Value);
|
||||||
StreamWriter sw = new StreamWriter(saveFileDialog.FileName);
|
StreamWriter sw = new StreamWriter(saveFileDialog.FileName);
|
||||||
string NameWithotPath = Path.GetFileName(saveFileDialog.FileName);
|
Text = Path.GetFileName(saveFileDialog.FileName) + " – " + PublicVar.appName;
|
||||||
Text = NameWithotPath + " – " + PublicVar.appName;
|
|
||||||
filePath = saveFileDialog.FileName;
|
filePath = saveFileDialog.FileName;
|
||||||
PublicVar.openFileName = Path.GetFileName(saveFileDialog.FileName);
|
PublicVar.openFileName = Path.GetFileName(saveFileDialog.FileName);
|
||||||
sw.Close();
|
sw.Close();
|
||||||
|
|
@ -1098,10 +1089,8 @@ private async void OpenMainMenu_Click(object sender, EventArgs e)
|
||||||
MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
||||||
if (res == DialogResult.No)
|
if (res == DialogResult.No)
|
||||||
{
|
{
|
||||||
string opnfile = File.ReadAllText(openFileDialog.FileName);
|
richTextBox.Text = File.ReadAllText(openFileDialog.FileName);
|
||||||
string NameWithotPath = Path.GetFileName(openFileDialog.FileName);
|
Text = Path.GetFileName(openFileDialog.FileName) + " – " + PublicVar.appName;
|
||||||
richTextBox.Text = opnfile;
|
|
||||||
Text = NameWithotPath + " – " + PublicVar.appName;
|
|
||||||
filePath = openFileDialog.FileName;
|
filePath = openFileDialog.FileName;
|
||||||
StatusPanelFileInfo();
|
StatusPanelFileInfo();
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue