From 56fab21a24e2a967f386b9d86ab17d44c6423f92 Mon Sep 17 00:00:00 2001 From: Vichingo455 <59311016+Vichingo455@users.noreply.github.com> Date: Thu, 10 Mar 2022 16:36:59 +0100 Subject: [PATCH] Actually 1.1 --- Notepad/Form1.Designer.cs | 15 ++++++- Notepad/Form1.cs | 65 ++++++++++++++++++++++++++++-- Notepad/Properties/AssemblyInfo.cs | 4 +- 3 files changed, 76 insertions(+), 8 deletions(-) diff --git a/Notepad/Form1.Designer.cs b/Notepad/Form1.Designer.cs index fef8d0f..c7df4e3 100644 --- a/Notepad/Form1.Designer.cs +++ b/Notepad/Form1.Designer.cs @@ -45,6 +45,7 @@ this.giveAFeedbackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutWindowsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.characterStyleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -139,7 +140,8 @@ // viewToolStripMenuItem // this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.alwaysOnTopToolStripMenuItem}); + this.alwaysOnTopToolStripMenuItem, + this.characterStyleToolStripMenuItem}); this.viewToolStripMenuItem.Name = "viewToolStripMenuItem"; this.viewToolStripMenuItem.Size = new System.Drawing.Size(55, 24); this.viewToolStripMenuItem.Text = "View"; @@ -149,7 +151,7 @@ // this.alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem"; this.alwaysOnTopToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5; - this.alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(210, 26); + this.alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(224, 26); this.alwaysOnTopToolStripMenuItem.Text = "Always on top"; this.alwaysOnTopToolStripMenuItem.Click += new System.EventHandler(this.alwaysOnTopToolStripMenuItem_Click); // @@ -198,6 +200,14 @@ this.aboutWindowsToolStripMenuItem.Visible = false; this.aboutWindowsToolStripMenuItem.Click += new System.EventHandler(this.aboutWindowsToolStripMenuItem_Click); // + // characterStyleToolStripMenuItem + // + this.characterStyleToolStripMenuItem.Name = "characterStyleToolStripMenuItem"; + this.characterStyleToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F7; + this.characterStyleToolStripMenuItem.Size = new System.Drawing.Size(224, 26); + this.characterStyleToolStripMenuItem.Text = "Character style"; + this.characterStyleToolStripMenuItem.Click += new System.EventHandler(this.characterStyleToolStripMenuItem_Click_1); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); @@ -235,6 +245,7 @@ private System.Windows.Forms.ToolStripMenuItem alwaysOnTopToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem giveAFeedbackToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem aboutWindowsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem characterStyleToolStripMenuItem; } } diff --git a/Notepad/Form1.cs b/Notepad/Form1.cs index 05300b3..592b809 100644 --- a/Notepad/Form1.cs +++ b/Notepad/Form1.cs @@ -151,7 +151,7 @@ namespace Notepad private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { - MessageBox.Show("Notepad\nVersion " + Program.GetCurrentVersionTostring() + "\nMaded by Vichingo455\nCopyright (C) 2022 Vichingo455. All rights reserved.\n\n\nReleased under GPL 3.0 License: you are free to\n- Modify\n- Use for business\n- Distribute\n- Use at home\n\nBut you have:\n- No liability\n- No warranty", Text); + MessageBox.Show("Notepad\nVersion " + Program.GetCurrentVersionTostring() + "" + "\nMaded by Vichingo455\nCopyright (C) 2022 Vichingo455. All rights reserved.\n\n\nReleased under GPL 3.0 License: you are free to\n- Modify\n- Use for business\n- Distribute\n- Use at home\n\nBut you have:\n- No liability\n- No warranty", Text); } /// /// Check for updates @@ -175,10 +175,17 @@ namespace Notepad } catch (Exception ex) { - var dialog = MessageBox.Show("The following exception occured: " + ex.Message + "\nDo you want to send a crash report", this.Text + " - Critical error", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); - if (dialog == DialogResult.Yes) + try { - Program.SendCrashReport(ex); + var dialog = MessageBox.Show("The following exception occured: " + ex.Message + "\nDo you want to send a crash report", this.Text + " - Critical error", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (dialog == DialogResult.Yes) + { + Program.SendCrashReport(ex); + } + } + catch + { + } } @@ -257,6 +264,22 @@ namespace Notepad { text_area.Text = File.ReadAllText(Global.savefilename); } + if (Global.confidential == "true") + { + var dialog = MessageBox.Show("This version is for testing purpouses only!!!\nYou should use it only for debugging.\nPublic publication of this version is fobidden and severally punished!! Do you agree?",Text,MessageBoxButtons.YesNo,MessageBoxIcon.None,MessageBoxDefaultButton.Button2); + if (dialog == DialogResult.Yes) + { + + } + else + { + Environment.Exit(436); + } + } + else + { + + } } private void aboutWindowsToolStripMenuItem_Click(object sender, EventArgs e) @@ -278,10 +301,44 @@ namespace Notepad } } } + + private void characterStyleToolStripMenuItem_Click(object sender, EventArgs e) + { + + } + + private void characterStyleToolStripMenuItem_Click_1(object sender, EventArgs e) + { + try + { + FontDialog stl = new FontDialog(); + if (stl.ShowDialog() == DialogResult.OK) + { + text_area.Font = stl.Font; + } + } + catch (Exception ex) + { + try + { + var dialog = MessageBox.Show("The following exception occured: " + ex.Message + "\nDo you want to send a crash report", this.Text + " - Critical error", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (dialog == DialogResult.Yes) + { + Program.SendCrashReport(ex); + } + } + catch + { + + } + } + } } public class Global { public static string savefilename; public static string transparency; + public static string confidential; + public static string fontsize; } } diff --git a/Notepad/Properties/AssemblyInfo.cs b/Notepad/Properties/AssemblyInfo.cs index 6de574f..793324d 100644 --- a/Notepad/Properties/AssemblyInfo.cs +++ b/Notepad/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build // usando l'asterisco '*' come illustrato di seguito: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.1.0.0")] +[assembly: AssemblyFileVersion("1.1.0.0")]