This commit is contained in:
Alexander 2019-08-21 14:15:16 +03:00
parent 562387d148
commit d956c3dd3b
7 changed files with 67 additions and 34 deletions

View file

@ -114,6 +114,9 @@
<setting name="InserKey" serializeAs="String">
<value>Enable</value>
</setting>
<setting name="CustomColor" serializeAs="String">
<value>0</value>
</setting>
</Crypto_Notepad.Properties.Settings>
<EncryptPad.Properties.Settings>
<setting name="TopPosition" serializeAs="String">

View file

@ -1,4 +1,4 @@
namespace Crypto_Notepad
namespace Crypto_Notepad
{
partial class MainForm
{

View file

@ -54,11 +54,11 @@ private void DecryptAES()
if (ps.TheSalt != null)
{
de = AES.Decrypt(opnfile, TypedPassword.Value, ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
de = AES.Decrypt(opnfile, TypedPassword.Value, ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
}
else
{
de = AES.Decrypt(opnfile, TypedPassword.Value, null, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
de = AES.Decrypt(opnfile, TypedPassword.Value, null, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
}
CustomRTB.Text = de;
@ -909,7 +909,7 @@ private void NewToolStripMenuItem_Click(object sender, EventArgs e)
if (filePath != "")
{
PublicVar.openFileName = Path.GetFileName(filePath);
}
}
TypedPassword.Value = null;
return;
}
@ -1481,7 +1481,7 @@ private void SearchTextBox_KeyDown(object sender, KeyEventArgs e)
private void CloseSearchPanel_Click(object sender, EventArgs e)
{
FindToolStripMenuItem_Click(this, new EventArgs());
}
}
private void CloseSearchPanel_MouseHover(object sender, EventArgs e)
{
@ -1524,7 +1524,8 @@ private void MainVariablesToolStripMenuItem_Click(object sender, EventArgs e)
#endif
}
/*Debug Menu*/
}
}
}

View file

@ -476,5 +476,18 @@ public string InserKey {
this["InserKey"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public string CustomColor {
get {
return ((string)(this["CustomColor"]));
}
set {
this["CustomColor"] = value;
}
}
}
}

View file

@ -107,5 +107,8 @@
<Setting Name="InserKey" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">Enable</Value>
</Setting>
<Setting Name="CustomColor" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
</Settings>
</SettingsFile>

View file

@ -56,6 +56,8 @@ private void InitializeComponent()
this.LNBackgroundColor = new System.Windows.Forms.Label();
this.LNVisibleLabel = new System.Windows.Forms.Label();
this.EditorGroupBox = new System.Windows.Forms.GroupBox();
this.InserKeyComboBox = new System.Windows.Forms.ComboBox();
this.InsertKeyLabel = new System.Windows.Forms.Label();
this.HighlightsColorPanel = new System.Windows.Forms.Panel();
this.FontNameComboBox = new System.Windows.Forms.ComboBox();
this.HighlightsColorLabel = new System.Windows.Forms.Label();
@ -86,8 +88,6 @@ private void InitializeComponent()
this.HashLabel = new System.Windows.Forms.Label();
this.ResetSettingsButton = new System.Windows.Forms.Button();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.InsertKeyLabel = new System.Windows.Forms.Label();
this.InserKeyComboBox = new System.Windows.Forms.ComboBox();
this.SettingsTabControl.SuspendLayout();
this.MainTabPage.SuspendLayout();
this.LineNumbersGroupBox.SuspendLayout();
@ -396,6 +396,27 @@ private void InitializeComponent()
this.EditorGroupBox.TabStop = false;
this.EditorGroupBox.Text = "Editor";
//
// InserKeyComboBox
//
this.InserKeyComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.InserKeyComboBox.FormattingEnabled = true;
this.InserKeyComboBox.Items.AddRange(new object[] {
"Enable",
"Disable"});
this.InserKeyComboBox.Location = new System.Drawing.Point(137, 165);
this.InserKeyComboBox.Name = "InserKeyComboBox";
this.InserKeyComboBox.Size = new System.Drawing.Size(100, 23);
this.InserKeyComboBox.TabIndex = 14;
//
// InsertKeyLabel
//
this.InsertKeyLabel.AutoSize = true;
this.InsertKeyLabel.Location = new System.Drawing.Point(9, 165);
this.InsertKeyLabel.Name = "InsertKeyLabel";
this.InsertKeyLabel.Size = new System.Drawing.Size(58, 15);
this.InsertKeyLabel.TabIndex = 13;
this.InsertKeyLabel.Text = "Insert key";
//
// HighlightsColorPanel
//
this.HighlightsColorPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
@ -499,7 +520,7 @@ private void InitializeComponent()
this.ApplicationTabPage.Location = new System.Drawing.Point(4, 24);
this.ApplicationTabPage.Name = "ApplicationTabPage";
this.ApplicationTabPage.Padding = new System.Windows.Forms.Padding(3);
this.ApplicationTabPage.Size = new System.Drawing.Size(278, 213);
this.ApplicationTabPage.Size = new System.Drawing.Size(278, 239);
this.ApplicationTabPage.TabIndex = 2;
this.ApplicationTabPage.Text = "Application";
//
@ -573,7 +594,7 @@ private void InitializeComponent()
this.IntegrationTabPage.Location = new System.Drawing.Point(4, 24);
this.IntegrationTabPage.Name = "IntegrationTabPage";
this.IntegrationTabPage.Padding = new System.Windows.Forms.Padding(3);
this.IntegrationTabPage.Size = new System.Drawing.Size(278, 213);
this.IntegrationTabPage.Size = new System.Drawing.Size(278, 239);
this.IntegrationTabPage.TabIndex = 3;
this.IntegrationTabPage.Text = "Integration";
this.IntegrationTabPage.UseVisualStyleBackColor = true;
@ -623,7 +644,7 @@ private void InitializeComponent()
this.EncryptionTabPage.Location = new System.Drawing.Point(4, 24);
this.EncryptionTabPage.Name = "EncryptionTabPage";
this.EncryptionTabPage.Padding = new System.Windows.Forms.Padding(3);
this.EncryptionTabPage.Size = new System.Drawing.Size(278, 213);
this.EncryptionTabPage.Size = new System.Drawing.Size(278, 239);
this.EncryptionTabPage.TabIndex = 1;
this.EncryptionTabPage.Text = "Encryption";
//
@ -721,27 +742,6 @@ private void InitializeComponent()
this.ResetSettingsButton.UseVisualStyleBackColor = true;
this.ResetSettingsButton.Click += new System.EventHandler(this.ResetSettingsButton_Click);
//
// InsertKeyLabel
//
this.InsertKeyLabel.AutoSize = true;
this.InsertKeyLabel.Location = new System.Drawing.Point(9, 165);
this.InsertKeyLabel.Name = "InsertKeyLabel";
this.InsertKeyLabel.Size = new System.Drawing.Size(58, 15);
this.InsertKeyLabel.TabIndex = 13;
this.InsertKeyLabel.Text = "Insert key";
//
// InserKeyComboBox
//
this.InserKeyComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.InserKeyComboBox.FormattingEnabled = true;
this.InserKeyComboBox.Items.AddRange(new object[] {
"Enable",
"Disable"});
this.InserKeyComboBox.Location = new System.Drawing.Point(137, 165);
this.InserKeyComboBox.Name = "InserKeyComboBox";
this.InserKeyComboBox.Size = new System.Drawing.Size(100, 23);
this.InserKeyComboBox.TabIndex = 14;
//
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -757,6 +757,7 @@ private void InitializeComponent()
this.Name = "SettingsForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Settings";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.SettingsForm_FormClosed);
this.Load += new System.EventHandler(this.SettingsForm_Load);
this.SettingsTabControl.ResumeLayout(false);
this.MainTabPage.ResumeLayout(false);

View file

@ -1,7 +1,8 @@
using Microsoft.Win32;
using Microsoft.Win32;
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
@ -106,7 +107,7 @@ private void SetSettings(string value)
ps.Save();
PublicVar.settingsChanged = true;
Hide();
Close();
}
if (value == "default")
@ -252,6 +253,10 @@ private void SettingsForm_Load(object sender, EventArgs e)
SaltTextBox.Visible = true;
SaltLabel.Visible = true;
}
string custom_colors = ps.CustomColor;
int[] array_of_colors = custom_colors.Split(';').Select(n => Convert.ToInt32(n)).ToArray();
colorDialog1.CustomColors = array_of_colors;
}
/*Form Events*/
@ -361,6 +366,13 @@ private void GLColorPanel_Click(object sender, EventArgs e)
GLColorPanel.BackColor = colorDialog1.Color;
}
private void SettingsForm_FormClosed(object sender, FormClosedEventArgs e)
{
string result = string.Join(";", colorDialog1.CustomColors);
ps.CustomColor = result;
ps.Save();
}
/*Settings Section*/
}
}