Сode simplification

This commit is contained in:
Alexander 2019-10-04 21:48:55 +03:00
parent cdd4b05590
commit 718968fdf5
2 changed files with 92 additions and 115 deletions

View file

@ -133,7 +133,6 @@ public void InitializeComponent()
// mainMenu // mainMenu
// //
this.mainMenu.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); this.mainMenu.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
this.mainMenu.DataBindings.Add(new System.Windows.Forms.Binding("Visible", global::Crypto_Notepad.Properties.Settings.Default, "mainMenu", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.mainMenu.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this.mainMenu.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileMainMenu, this.fileMainMenu,
@ -144,10 +143,9 @@ public void InitializeComponent()
this.mainMenu.Location = new System.Drawing.Point(0, 0); this.mainMenu.Location = new System.Drawing.Point(0, 0);
this.mainMenu.Name = "mainMenu"; this.mainMenu.Name = "mainMenu";
this.mainMenu.Padding = new System.Windows.Forms.Padding(0); this.mainMenu.Padding = new System.Windows.Forms.Padding(0);
this.mainMenu.Size = new System.Drawing.Size(484, 24); this.mainMenu.Size = new System.Drawing.Size(598, 24);
this.mainMenu.TabIndex = 0; this.mainMenu.TabIndex = 0;
this.mainMenu.Text = "menuStrip1"; this.mainMenu.Text = "menuStrip1";
this.mainMenu.Visible = global::Crypto_Notepad.Properties.Settings.Default.mainMenu;
// //
// fileMainMenu // fileMainMenu
// //
@ -562,7 +560,6 @@ public void InitializeComponent()
// //
// rightToLeftContextMenu // rightToLeftContextMenu
// //
this.rightToLeftContextMenu.Checked = global::Crypto_Notepad.Properties.Settings.Default.editorRightToLeft;
this.rightToLeftContextMenu.CheckOnClick = true; this.rightToLeftContextMenu.CheckOnClick = true;
this.rightToLeftContextMenu.ForeColor = System.Drawing.SystemColors.ControlText; this.rightToLeftContextMenu.ForeColor = System.Drawing.SystemColors.ControlText;
this.rightToLeftContextMenu.Name = "rightToLeftContextMenu"; this.rightToLeftContextMenu.Name = "rightToLeftContextMenu";
@ -588,27 +585,26 @@ public void InitializeComponent()
// //
// searchPanel // searchPanel
// //
this.searchPanel.BackColor = global::Crypto_Notepad.Properties.Settings.Default.searchPanelBackColor; this.searchPanel.BackColor = System.Drawing.Color.White;
this.searchPanel.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single; this.searchPanel.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
this.searchPanel.ColumnCount = 5; this.searchPanel.ColumnCount = 5;
this.searchPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.searchPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.searchPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.searchPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
this.searchPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.searchPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
this.searchPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.searchPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 70F));
this.searchPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 21F)); this.searchPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25F));
this.searchPanel.Controls.Add(this.findNextButton, 3, 0); this.searchPanel.Controls.Add(this.findNextButton, 3, 0);
this.searchPanel.Controls.Add(this.searchTextBox, 0, 0); this.searchPanel.Controls.Add(this.searchTextBox, 0, 0);
this.searchPanel.Controls.Add(this.wholeWordCheckBox, 2, 0); this.searchPanel.Controls.Add(this.wholeWordCheckBox, 2, 0);
this.searchPanel.Controls.Add(this.caseSensitiveCheckBox, 1, 0); this.searchPanel.Controls.Add(this.caseSensitiveCheckBox, 1, 0);
this.searchPanel.Controls.Add(this.closeSearchPanel, 4, 0); this.searchPanel.Controls.Add(this.closeSearchPanel, 4, 0);
this.searchPanel.DataBindings.Add(new System.Windows.Forms.Binding("BackColor", global::Crypto_Notepad.Properties.Settings.Default, "searchPanelBackColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.searchPanel.Dock = System.Windows.Forms.DockStyle.Bottom; this.searchPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
this.searchPanel.ForeColor = System.Drawing.Color.Black; this.searchPanel.ForeColor = System.Drawing.Color.Black;
this.searchPanel.Location = new System.Drawing.Point(0, 211); this.searchPanel.Location = new System.Drawing.Point(0, 335);
this.searchPanel.Name = "searchPanel"; this.searchPanel.Name = "searchPanel";
this.searchPanel.RowCount = 1; this.searchPanel.RowCount = 1;
this.searchPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.searchPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.searchPanel.Size = new System.Drawing.Size(484, 28); this.searchPanel.Size = new System.Drawing.Size(598, 28);
this.searchPanel.TabIndex = 17; this.searchPanel.TabIndex = 17;
this.searchPanel.Visible = false; this.searchPanel.Visible = false;
// //
@ -616,17 +612,16 @@ public void InitializeComponent()
// //
this.findNextButton.BackColor = System.Drawing.Color.Transparent; this.findNextButton.BackColor = System.Drawing.Color.Transparent;
this.findNextButton.Cursor = System.Windows.Forms.Cursors.Hand; this.findNextButton.Cursor = System.Windows.Forms.Cursors.Hand;
this.findNextButton.DataBindings.Add(new System.Windows.Forms.Binding("ForeColor", global::Crypto_Notepad.Properties.Settings.Default, "searchPanelFontColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.findNextButton.Dock = System.Windows.Forms.DockStyle.Fill; this.findNextButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.findNextButton.FlatAppearance.BorderColor = System.Drawing.Color.Black; this.findNextButton.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.findNextButton.FlatAppearance.BorderSize = 0; this.findNextButton.FlatAppearance.BorderSize = 0;
this.findNextButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; this.findNextButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent;
this.findNextButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; this.findNextButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent;
this.findNextButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.findNextButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.findNextButton.ForeColor = global::Crypto_Notepad.Properties.Settings.Default.searchPanelFontColor; this.findNextButton.ForeColor = System.Drawing.Color.Black;
this.findNextButton.Location = new System.Drawing.Point(398, 4); this.findNextButton.Location = new System.Drawing.Point(504, 4);
this.findNextButton.Name = "findNextButton"; this.findNextButton.Name = "findNextButton";
this.findNextButton.Size = new System.Drawing.Size(60, 20); this.findNextButton.Size = new System.Drawing.Size(64, 20);
this.findNextButton.TabIndex = 15; this.findNextButton.TabIndex = 15;
this.findNextButton.TabStop = false; this.findNextButton.TabStop = false;
this.findNextButton.Text = "Find Next"; this.findNextButton.Text = "Find Next";
@ -637,14 +632,12 @@ public void InitializeComponent()
// searchTextBox // searchTextBox
// //
this.searchTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.searchTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.searchTextBox.BackColor = global::Crypto_Notepad.Properties.Settings.Default.searchPanelBackColor; this.searchTextBox.BackColor = System.Drawing.SystemColors.Control;
this.searchTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; this.searchTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.searchTextBox.DataBindings.Add(new System.Windows.Forms.Binding("ForeColor", global::Crypto_Notepad.Properties.Settings.Default, "searchPanelFontColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.searchTextBox.ForeColor = System.Drawing.Color.Black;
this.searchTextBox.DataBindings.Add(new System.Windows.Forms.Binding("BackColor", global::Crypto_Notepad.Properties.Settings.Default, "searchPanelBackColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.searchTextBox.ForeColor = global::Crypto_Notepad.Properties.Settings.Default.searchPanelFontColor;
this.searchTextBox.Location = new System.Drawing.Point(4, 7); this.searchTextBox.Location = new System.Drawing.Point(4, 7);
this.searchTextBox.Name = "searchTextBox"; this.searchTextBox.Name = "searchTextBox";
this.searchTextBox.Size = new System.Drawing.Size(196, 13); this.searchTextBox.Size = new System.Drawing.Size(291, 13);
this.searchTextBox.TabIndex = 9; this.searchTextBox.TabIndex = 9;
this.searchTextBox.TabStop = false; this.searchTextBox.TabStop = false;
this.searchTextBox.TextChanged += new System.EventHandler(this.SearchTextBox_TextChanged); this.searchTextBox.TextChanged += new System.EventHandler(this.SearchTextBox_TextChanged);
@ -654,13 +647,12 @@ public void InitializeComponent()
// //
this.wholeWordCheckBox.AutoSize = true; this.wholeWordCheckBox.AutoSize = true;
this.wholeWordCheckBox.BackColor = System.Drawing.Color.Transparent; this.wholeWordCheckBox.BackColor = System.Drawing.Color.Transparent;
this.wholeWordCheckBox.DataBindings.Add(new System.Windows.Forms.Binding("ForeColor", global::Crypto_Notepad.Properties.Settings.Default, "searchPanelFontColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.wholeWordCheckBox.Dock = System.Windows.Forms.DockStyle.Fill; this.wholeWordCheckBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.wholeWordCheckBox.ForeColor = global::Crypto_Notepad.Properties.Settings.Default.searchPanelFontColor; this.wholeWordCheckBox.ForeColor = System.Drawing.Color.Black;
this.wholeWordCheckBox.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.wholeWordCheckBox.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.wholeWordCheckBox.Location = new System.Drawing.Point(308, 4); this.wholeWordCheckBox.Location = new System.Drawing.Point(403, 4);
this.wholeWordCheckBox.Name = "wholeWordCheckBox"; this.wholeWordCheckBox.Name = "wholeWordCheckBox";
this.wholeWordCheckBox.Size = new System.Drawing.Size(83, 20); this.wholeWordCheckBox.Size = new System.Drawing.Size(94, 20);
this.wholeWordCheckBox.TabIndex = 12; this.wholeWordCheckBox.TabIndex = 12;
this.wholeWordCheckBox.Text = "Whole word"; this.wholeWordCheckBox.Text = "Whole word";
this.wholeWordCheckBox.TextAlign = System.Drawing.ContentAlignment.BottomLeft; this.wholeWordCheckBox.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
@ -671,11 +663,10 @@ public void InitializeComponent()
// //
this.caseSensitiveCheckBox.AutoSize = true; this.caseSensitiveCheckBox.AutoSize = true;
this.caseSensitiveCheckBox.BackColor = System.Drawing.Color.Transparent; this.caseSensitiveCheckBox.BackColor = System.Drawing.Color.Transparent;
this.caseSensitiveCheckBox.DataBindings.Add(new System.Windows.Forms.Binding("ForeColor", global::Crypto_Notepad.Properties.Settings.Default, "searchPanelFontColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.caseSensitiveCheckBox.Dock = System.Windows.Forms.DockStyle.Fill; this.caseSensitiveCheckBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.caseSensitiveCheckBox.ForeColor = global::Crypto_Notepad.Properties.Settings.Default.searchPanelFontColor; this.caseSensitiveCheckBox.ForeColor = System.Drawing.Color.Black;
this.caseSensitiveCheckBox.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.caseSensitiveCheckBox.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.caseSensitiveCheckBox.Location = new System.Drawing.Point(207, 4); this.caseSensitiveCheckBox.Location = new System.Drawing.Point(302, 4);
this.caseSensitiveCheckBox.Name = "caseSensitiveCheckBox"; this.caseSensitiveCheckBox.Name = "caseSensitiveCheckBox";
this.caseSensitiveCheckBox.Size = new System.Drawing.Size(94, 20); this.caseSensitiveCheckBox.Size = new System.Drawing.Size(94, 20);
this.caseSensitiveCheckBox.TabIndex = 11; this.caseSensitiveCheckBox.TabIndex = 11;
@ -690,10 +681,10 @@ public void InitializeComponent()
this.closeSearchPanel.Cursor = System.Windows.Forms.Cursors.Hand; this.closeSearchPanel.Cursor = System.Windows.Forms.Cursors.Hand;
this.closeSearchPanel.Image = ((System.Drawing.Image)(resources.GetObject("closeSearchPanel.Image"))); this.closeSearchPanel.Image = ((System.Drawing.Image)(resources.GetObject("closeSearchPanel.Image")));
this.closeSearchPanel.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.closeSearchPanel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.closeSearchPanel.Location = new System.Drawing.Point(465, 4); this.closeSearchPanel.Location = new System.Drawing.Point(575, 4);
this.closeSearchPanel.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3); this.closeSearchPanel.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3);
this.closeSearchPanel.Name = "closeSearchPanel"; this.closeSearchPanel.Name = "closeSearchPanel";
this.closeSearchPanel.Size = new System.Drawing.Size(15, 19); this.closeSearchPanel.Size = new System.Drawing.Size(15, 20);
this.closeSearchPanel.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.closeSearchPanel.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.closeSearchPanel.TabIndex = 14; this.closeSearchPanel.TabIndex = 14;
this.closeSearchPanel.TabStop = false; this.closeSearchPanel.TabStop = false;
@ -703,7 +694,7 @@ public void InitializeComponent()
// //
// toolbarPanel // toolbarPanel
// //
this.toolbarPanel.BackColor = global::Crypto_Notepad.Properties.Settings.Default.toolbarBackColor; this.toolbarPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
this.toolbarPanel.ColumnCount = 13; this.toolbarPanel.ColumnCount = 13;
this.toolbarPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 24F)); this.toolbarPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 24F));
this.toolbarPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 24F)); this.toolbarPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 24F));
@ -730,17 +721,14 @@ public void InitializeComponent()
this.toolbarPanel.Controls.Add(this.deleteFileToolbarButton, 4, 0); this.toolbarPanel.Controls.Add(this.deleteFileToolbarButton, 4, 0);
this.toolbarPanel.Controls.Add(this.closeToolbarButton, 12, 0); this.toolbarPanel.Controls.Add(this.closeToolbarButton, 12, 0);
this.toolbarPanel.Controls.Add(this.settingsToolbarButton, 10, 0); this.toolbarPanel.Controls.Add(this.settingsToolbarButton, 10, 0);
this.toolbarPanel.DataBindings.Add(new System.Windows.Forms.Binding("BackColor", global::Crypto_Notepad.Properties.Settings.Default, "toolbarBackColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.toolbarPanel.DataBindings.Add(new System.Windows.Forms.Binding("Visible", global::Crypto_Notepad.Properties.Settings.Default, "showToolbar", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.toolbarPanel.Dock = System.Windows.Forms.DockStyle.Top; this.toolbarPanel.Dock = System.Windows.Forms.DockStyle.Top;
this.toolbarPanel.ForeColor = System.Drawing.SystemColors.Control; this.toolbarPanel.ForeColor = System.Drawing.SystemColors.Control;
this.toolbarPanel.Location = new System.Drawing.Point(0, 24); this.toolbarPanel.Location = new System.Drawing.Point(0, 24);
this.toolbarPanel.Name = "toolbarPanel"; this.toolbarPanel.Name = "toolbarPanel";
this.toolbarPanel.RowCount = 1; this.toolbarPanel.RowCount = 1;
this.toolbarPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.toolbarPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.toolbarPanel.Size = new System.Drawing.Size(484, 25); this.toolbarPanel.Size = new System.Drawing.Size(598, 25);
this.toolbarPanel.TabIndex = 17; this.toolbarPanel.TabIndex = 17;
this.toolbarPanel.Visible = global::Crypto_Notepad.Properties.Settings.Default.showToolbar;
// //
// lockToolbarButton // lockToolbarButton
// //
@ -878,7 +866,7 @@ public void InitializeComponent()
this.closeToolbarButton.Dock = System.Windows.Forms.DockStyle.Fill; this.closeToolbarButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.closeToolbarButton.Image = global::Crypto_Notepad.Properties.Resources.close_g; this.closeToolbarButton.Image = global::Crypto_Notepad.Properties.Resources.close_g;
this.closeToolbarButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.closeToolbarButton.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.closeToolbarButton.Location = new System.Drawing.Point(467, 3); this.closeToolbarButton.Location = new System.Drawing.Point(581, 3);
this.closeToolbarButton.Margin = new System.Windows.Forms.Padding(3, 3, 2, 3); this.closeToolbarButton.Margin = new System.Windows.Forms.Padding(3, 3, 2, 3);
this.closeToolbarButton.Name = "closeToolbarButton"; this.closeToolbarButton.Name = "closeToolbarButton";
this.closeToolbarButton.Size = new System.Drawing.Size(15, 19); this.closeToolbarButton.Size = new System.Drawing.Size(15, 19);
@ -904,23 +892,19 @@ public void InitializeComponent()
// //
// statusPanel // statusPanel
// //
this.statusPanel.BackColor = global::Crypto_Notepad.Properties.Settings.Default.statusPanelBackColor; this.statusPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
this.statusPanel.DataBindings.Add(new System.Windows.Forms.Binding("Visible", global::Crypto_Notepad.Properties.Settings.Default, "statusPanel", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.statusPanel.DataBindings.Add(new System.Windows.Forms.Binding("BackColor", global::Crypto_Notepad.Properties.Settings.Default, "statusPanelBackColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.statusPanel.DataBindings.Add(new System.Windows.Forms.Binding("ForeColor", global::Crypto_Notepad.Properties.Settings.Default, "statusPanelFontColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.statusPanel.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this.statusPanel.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.statusPanel.ForeColor = global::Crypto_Notepad.Properties.Settings.Default.statusPanelFontColor; this.statusPanel.ForeColor = System.Drawing.Color.Black;
this.statusPanel.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.statusPanel.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.statusLabel, this.statusLabel,
this.lengthStatusLabel, this.lengthStatusLabel,
this.linesStatusLabel, this.linesStatusLabel,
this.lnStatusLabel, this.lnStatusLabel,
this.colStatusLabel}); this.colStatusLabel});
this.statusPanel.Location = new System.Drawing.Point(0, 239); this.statusPanel.Location = new System.Drawing.Point(0, 363);
this.statusPanel.Name = "statusPanel"; this.statusPanel.Name = "statusPanel";
this.statusPanel.Size = new System.Drawing.Size(484, 22); this.statusPanel.Size = new System.Drawing.Size(598, 22);
this.statusPanel.TabIndex = 18; this.statusPanel.TabIndex = 18;
this.statusPanel.Visible = global::Crypto_Notepad.Properties.Settings.Default.statusPanel;
// //
// statusLabel // statusLabel
// //
@ -977,18 +961,15 @@ public void InitializeComponent()
// richTextBox // richTextBox
// //
this.richTextBox.AcceptsTab = true; this.richTextBox.AcceptsTab = true;
this.richTextBox.BackColor = global::Crypto_Notepad.Properties.Settings.Default.editorBackColor; this.richTextBox.BackColor = System.Drawing.Color.White;
this.richTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; this.richTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.richTextBox.ContextMenuStrip = this.contextMenu; this.richTextBox.ContextMenuStrip = this.contextMenu;
this.richTextBox.DataBindings.Add(new System.Windows.Forms.Binding("BackColor", global::Crypto_Notepad.Properties.Settings.Default, "editorBackColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.richTextBox.DataBindings.Add(new System.Windows.Forms.Binding("ForeColor", global::Crypto_Notepad.Properties.Settings.Default, "editroFontColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.richTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Font", global::Crypto_Notepad.Properties.Settings.Default, "editorFont", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.richTextBox.Dock = System.Windows.Forms.DockStyle.Fill; this.richTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox.Font = global::Crypto_Notepad.Properties.Settings.Default.editorFont; this.richTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F);
this.richTextBox.ForeColor = global::Crypto_Notepad.Properties.Settings.Default.editroFontColor; this.richTextBox.ForeColor = System.Drawing.Color.Black;
this.richTextBox.Location = new System.Drawing.Point(22, 49); this.richTextBox.Location = new System.Drawing.Point(22, 49);
this.richTextBox.Name = "richTextBox"; this.richTextBox.Name = "richTextBox";
this.richTextBox.Size = new System.Drawing.Size(462, 162); this.richTextBox.Size = new System.Drawing.Size(576, 286);
this.richTextBox.TabIndex = 16; this.richTextBox.TabIndex = 16;
this.richTextBox.Text = ""; this.richTextBox.Text = "";
this.richTextBox.CursorPositionChanged += new System.EventHandler(this.RichTextBox_CursorPositionChanged); this.richTextBox.CursorPositionChanged += new System.EventHandler(this.RichTextBox_CursorPositionChanged);
@ -1002,20 +983,17 @@ public void InitializeComponent()
// //
this.RTBLineNumbers._SeeThroughMode_ = false; this.RTBLineNumbers._SeeThroughMode_ = false;
this.RTBLineNumbers.AutoSizing = true; this.RTBLineNumbers.AutoSizing = true;
this.RTBLineNumbers.BackColor = global::Crypto_Notepad.Properties.Settings.Default.lnBackColor; this.RTBLineNumbers.BackColor = System.Drawing.SystemColors.Control;
this.RTBLineNumbers.BackgroundGradient_AlphaColor = System.Drawing.Color.Transparent; this.RTBLineNumbers.BackgroundGradient_AlphaColor = System.Drawing.Color.Transparent;
this.RTBLineNumbers.BackgroundGradient_BetaColor = System.Drawing.Color.Transparent; this.RTBLineNumbers.BackgroundGradient_BetaColor = System.Drawing.Color.Transparent;
this.RTBLineNumbers.BackgroundGradient_Direction = System.Drawing.Drawing2D.LinearGradientMode.Horizontal; this.RTBLineNumbers.BackgroundGradient_Direction = System.Drawing.Drawing2D.LinearGradientMode.Horizontal;
this.RTBLineNumbers.BorderLines_Color = System.Drawing.Color.Transparent; this.RTBLineNumbers.BorderLines_Color = System.Drawing.Color.Transparent;
this.RTBLineNumbers.BorderLines_Style = System.Drawing.Drawing2D.DashStyle.Solid; this.RTBLineNumbers.BorderLines_Style = System.Drawing.Drawing2D.DashStyle.Solid;
this.RTBLineNumbers.BorderLines_Thickness = 1F; this.RTBLineNumbers.BorderLines_Thickness = 1F;
this.RTBLineNumbers.DataBindings.Add(new System.Windows.Forms.Binding("Font", global::Crypto_Notepad.Properties.Settings.Default, "editorFont", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.RTBLineNumbers.DataBindings.Add(new System.Windows.Forms.Binding("BackColor", global::Crypto_Notepad.Properties.Settings.Default, "lnBackColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.RTBLineNumbers.DataBindings.Add(new System.Windows.Forms.Binding("ForeColor", global::Crypto_Notepad.Properties.Settings.Default, "lnFontColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.RTBLineNumbers.Dock = System.Windows.Forms.DockStyle.Left; this.RTBLineNumbers.Dock = System.Windows.Forms.DockStyle.Left;
this.RTBLineNumbers.DockSide = LineNumbers.LineNumbers.LineNumberDockSide.Left; this.RTBLineNumbers.DockSide = LineNumbers.LineNumbers.LineNumberDockSide.Left;
this.RTBLineNumbers.Font = global::Crypto_Notepad.Properties.Settings.Default.editorFont; this.RTBLineNumbers.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F);
this.RTBLineNumbers.ForeColor = global::Crypto_Notepad.Properties.Settings.Default.lnFontColor; this.RTBLineNumbers.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(164)))), ((int)(((byte)(164)))), ((int)(((byte)(164)))));
this.RTBLineNumbers.GridLines_Color = System.Drawing.Color.Transparent; this.RTBLineNumbers.GridLines_Color = System.Drawing.Color.Transparent;
this.RTBLineNumbers.GridLines_Style = System.Drawing.Drawing2D.DashStyle.Solid; this.RTBLineNumbers.GridLines_Style = System.Drawing.Drawing2D.DashStyle.Solid;
this.RTBLineNumbers.GridLines_Thickness = 1F; this.RTBLineNumbers.GridLines_Thickness = 1F;
@ -1034,27 +1012,26 @@ public void InitializeComponent()
this.RTBLineNumbers.Name = "RTBLineNumbers"; this.RTBLineNumbers.Name = "RTBLineNumbers";
this.RTBLineNumbers.Padding = new System.Windows.Forms.Padding(0, 0, 2, 0); this.RTBLineNumbers.Padding = new System.Windows.Forms.Padding(0, 0, 2, 0);
this.RTBLineNumbers.ParentRichTextBox = this.richTextBox; this.RTBLineNumbers.ParentRichTextBox = this.richTextBox;
this.RTBLineNumbers.Show_BackgroundGradient = true; this.RTBLineNumbers.Show_BackgroundGradient = false;
this.RTBLineNumbers.Show_BorderLines = false; this.RTBLineNumbers.Show_BorderLines = false;
this.RTBLineNumbers.Show_GridLines = true; this.RTBLineNumbers.Show_GridLines = false;
this.RTBLineNumbers.Show_LineNrs = true; this.RTBLineNumbers.Show_LineNrs = true;
this.RTBLineNumbers.Show_MarginLines = true; this.RTBLineNumbers.Show_MarginLines = false;
this.RTBLineNumbers.Size = new System.Drawing.Size(22, 162); this.RTBLineNumbers.Size = new System.Drawing.Size(22, 286);
this.RTBLineNumbers.TabIndex = 19; this.RTBLineNumbers.TabIndex = 19;
// //
// MainForm // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = global::Crypto_Notepad.Properties.Settings.Default.editorBackColor; this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(484, 261); this.ClientSize = new System.Drawing.Size(598, 385);
this.Controls.Add(this.richTextBox); this.Controls.Add(this.richTextBox);
this.Controls.Add(this.RTBLineNumbers); this.Controls.Add(this.RTBLineNumbers);
this.Controls.Add(this.searchPanel); this.Controls.Add(this.searchPanel);
this.Controls.Add(this.toolbarPanel); this.Controls.Add(this.toolbarPanel);
this.Controls.Add(this.mainMenu); this.Controls.Add(this.mainMenu);
this.Controls.Add(this.statusPanel); this.Controls.Add(this.statusPanel);
this.DataBindings.Add(new System.Windows.Forms.Binding("BackColor", global::Crypto_Notepad.Properties.Settings.Default, "editorBackColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.ForeColor = System.Drawing.Color.Black; this.ForeColor = System.Drawing.Color.Black;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
@ -1173,7 +1150,7 @@ public void InitializeComponent()
protected internal System.Windows.Forms.CheckBox wholeWordCheckBox; protected internal System.Windows.Forms.CheckBox wholeWordCheckBox;
protected internal System.Windows.Forms.Button findNextButton; protected internal System.Windows.Forms.Button findNextButton;
public System.Windows.Forms.TableLayoutPanel searchPanel; public System.Windows.Forms.TableLayoutPanel searchPanel;
private System.Windows.Forms.PictureBox closeSearchPanel;
public System.Windows.Forms.MenuStrip mainMenu; public System.Windows.Forms.MenuStrip mainMenu;
private System.Windows.Forms.PictureBox closeSearchPanel;
} }
} }

View file

@ -1,4 +1,4 @@
using Crypto_Notepad.Properties; using Crypto_Notepad.Properties;
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
@ -8,7 +8,6 @@
using System.Net; using System.Net;
using System.Reflection; using System.Reflection;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
@ -16,7 +15,7 @@ namespace Crypto_Notepad
{ {
public partial class MainForm : Form public partial class MainForm : Form
{ {
Properties.Settings settings = Properties.Settings.Default; Properties.Settings settings = Settings.Default;
readonly string[] args = Environment.GetCommandLineArgs(); readonly string[] args = Environment.GetCommandLineArgs();
bool preventExit = false; bool preventExit = false;
string filePath = ""; string filePath = "";
@ -379,42 +378,42 @@ private void CheckForUpdates(bool autoCheck)
if (serverVersion > appVersion) if (serverVersion > appVersion)
{ {
if (statusPanel.Visible) if (statusPanel.Visible)
{
StatusPanelMessage("update-needed");
}
else
{
using (new CenterWinDialog(this))
{ {
StatusPanelMessage("update-needed"); DialogResult res = MessageBox.Show("New version is available. Install it now?", PublicVar.appName, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
} if (res == DialogResult.Yes)
else
{
using (new CenterWinDialog(this))
{ {
DialogResult res = MessageBox.Show("New version is available. Install it now?", PublicVar.appName, MessageBoxButtons.YesNo, MessageBoxIcon.Information); File.WriteAllBytes(exePath + "Ionic.Zip.dll", Resources.Ionic_Zip);
if (res == DialogResult.Yes) File.WriteAllBytes(exePath + "Updater.exe", Resources.Updater);
{ var pr = new Process();
File.WriteAllBytes(exePath + "Ionic.Zip.dll", Properties.Resources.Ionic_Zip); pr.StartInfo.FileName = exePath + "Updater.exe";
File.WriteAllBytes(exePath + "Updater.exe", Properties.Resources.Updater); pr.StartInfo.Arguments = "/u";
var pr = new Process(); pr.Start();
pr.StartInfo.FileName = exePath + "Updater.exe"; Application.Exit();
pr.StartInfo.Arguments = "/u";
pr.Start();
Application.Exit();
}
} }
} }
}
} }
if (serverVersion <= appVersion && autoCheck) if (serverVersion <= appVersion && autoCheck)
{ {
using (new CenterWinDialog(this)) using (new CenterWinDialog(this))
{
if (statusPanel.Visible)
{ {
if (statusPanel.Visible) StatusPanelMessage("update-missing");
{
StatusPanelMessage("update-missing");
}
else
{
MessageBox.Show("Crypto Notepad is up to date.", PublicVar.appName, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
} }
else
{
MessageBox.Show("Crypto Notepad is up to date.", PublicVar.appName, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
} }
} }
catch catch
@ -687,9 +686,9 @@ public void MenuIcons(bool menuIcons)
} }
} }
public void Toolbaricons(bool oldicons) public void Toolbaricons(bool oldIcons)
{ {
if (oldicons) if (oldIcons)
{ {
newToolbarButton.Image = Resources.old_page_white_add; newToolbarButton.Image = Resources.old_page_white_add;
openToolbarButton.Image = Resources.old_folder_vertical_document; openToolbarButton.Image = Resources.old_folder_vertical_document;
@ -967,8 +966,8 @@ private void StatusLabel_Click(object sender, EventArgs e)
DialogResult res = MessageBox.Show("New version is available. Install it now?", PublicVar.appName, MessageBoxButtons.YesNo, MessageBoxIcon.Information); DialogResult res = MessageBox.Show("New version is available. Install it now?", PublicVar.appName, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (res == DialogResult.Yes) if (res == DialogResult.Yes)
{ {
File.WriteAllBytes(exePath + "Ionic.Zip.dll", Properties.Resources.Ionic_Zip); File.WriteAllBytes(exePath + "Ionic.Zip.dll", Resources.Ionic_Zip);
File.WriteAllBytes(exePath + "Updater.exe", Properties.Resources.Updater); File.WriteAllBytes(exePath + "Updater.exe", Resources.Updater);
var pr = new Process(); var pr = new Process();
pr.StartInfo.FileName = exePath + "Updater.exe"; pr.StartInfo.FileName = exePath + "Updater.exe";
pr.StartInfo.Arguments = "/u"; pr.StartInfo.Arguments = "/u";
@ -1514,16 +1513,17 @@ private void LockToolbarButton_Click(object sender, EventArgs e)
private void CloseToolbarButton_Click(object sender, EventArgs e) private void CloseToolbarButton_Click(object sender, EventArgs e)
{ {
toolbarPanel.Visible = false; toolbarPanel.Visible = false;
settings.toolbarVisible = false;
} }
private void CloseToolbarButton_MouseEnter(object sender, EventArgs e) private void CloseToolbarButton_MouseEnter(object sender, EventArgs e)
{ {
closeToolbarButton.Image = Properties.Resources.close_b; closeToolbarButton.Image = Resources.close_b;
} }
private void CloseToolbarButton_MouseLeave(object sender, EventArgs e) private void CloseToolbarButton_MouseLeave(object sender, EventArgs e)
{ {
closeToolbarButton.Image = Properties.Resources.close_g; closeToolbarButton.Image = Resources.close_g;
} }
#endregion #endregion
@ -1560,12 +1560,12 @@ private void CloseSearchPanel_Click(object sender, EventArgs e)
private void CloseSearchPanel_MouseHover(object sender, EventArgs e) private void CloseSearchPanel_MouseHover(object sender, EventArgs e)
{ {
closeSearchPanel.Image = Properties.Resources.close_b; closeSearchPanel.Image = Resources.close_b;
} }
private void CloseSearchPanel_MouseLeave(object sender, EventArgs e) private void CloseSearchPanel_MouseLeave(object sender, EventArgs e)
{ {
closeSearchPanel.Image = Properties.Resources.close_g; closeSearchPanel.Image = Resources.close_g;
} }
private void CaseSensitiveCheckBox_CheckedChanged(object sender, EventArgs e) private void CaseSensitiveCheckBox_CheckedChanged(object sender, EventArgs e)
@ -1636,19 +1636,19 @@ private void FindNextButton_Click(object sender, EventArgs e)
#region Debug Menu #region Debug Menu
private void VariablesMainMenu_Click(object sender, EventArgs e) private void VariablesMainMenu_Click(object sender, EventArgs e)
{ {
#if DEBUG #if DEBUG
string formattedTime = DateTime.Now.ToString("yyyy.MM.dd hh:mm:ss"); string formattedTime = DateTime.Now.ToString("yyyy.MM.dd hh:mm:ss");
Debug.WriteLine("\nTime: " + formattedTime); Debug.WriteLine("\nTime: " + formattedTime);
Debug.WriteLine("PublicVar.openFileName: " + PublicVar.openFileName); Debug.WriteLine("PublicVar.openFileName: " + PublicVar.openFileName);
Debug.WriteLine("filePath: " + filePath); Debug.WriteLine("filePath: " + filePath);
Debug.WriteLine("encryptionKey: " + PublicVar.encryptionKey.Get()); Debug.WriteLine("encryptionKey: " + PublicVar.encryptionKey.Get());
Debug.WriteLine("TypedPassword: " + TypedPassword.Value); Debug.WriteLine("TypedPassword: " + TypedPassword.Value);
Debug.WriteLine("preventExit: " + preventExit); Debug.WriteLine("preventExit: " + preventExit);
Debug.WriteLine("keyChanged: " + PublicVar.keyChanged); Debug.WriteLine("keyChanged: " + PublicVar.keyChanged);
Debug.WriteLine("okPressed: " + PublicVar.okPressed); Debug.WriteLine("okPressed: " + PublicVar.okPressed);
Debug.WriteLine("RichTextBox.Modified: " + richTextBox.Modified); Debug.WriteLine("RichTextBox.Modified: " + richTextBox.Modified);
Debug.WriteLine("EditorMenuStrip: " + contextMenu.Enabled); Debug.WriteLine("EditorMenuStrip: " + contextMenu.Enabled);
#endif #endif
} }
#endregion #endregion