From 4c52a983733d21f4d627eb5c81cabd37ec8c2b3d Mon Sep 17 00:00:00 2001 From: Brendan Date: Fri, 31 May 2024 22:32:59 +0200 Subject: [PATCH] removed the border around the text box and fixed the "Open With" function --- V_EditorPro/AboutForm.Designer.cs | 2 +- V_EditorPro/AboutForm.cs | 2 +- V_EditorPro/MainForm.cs | 15 +++++++++-- V_EditorPro/Program.cs | 19 +++++++++++--- V_EditorPro/Properties/AssemblyInfo.cs | 4 +-- V_EditorProSetup/V_EditorProSetup.vdproj | 32 ++++++++++++++++++------ 6 files changed, 57 insertions(+), 17 deletions(-) diff --git a/V_EditorPro/AboutForm.Designer.cs b/V_EditorPro/AboutForm.Designer.cs index de638e4..e50a553 100644 --- a/V_EditorPro/AboutForm.Designer.cs +++ b/V_EditorPro/AboutForm.Designer.cs @@ -34,7 +34,7 @@ this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(63, 39); this.label1.TabIndex = 0; - this.label1.Text = "V_EditorPro\nVersion 1.0\nOS: "; + this.label1.Text = "V_EditorPro\nVersion 1.1\nOS: "; // // pictureBox1 // diff --git a/V_EditorPro/AboutForm.cs b/V_EditorPro/AboutForm.cs index 6cb8a19..ee24acf 100644 --- a/V_EditorPro/AboutForm.cs +++ b/V_EditorPro/AboutForm.cs @@ -12,7 +12,7 @@ namespace V_EditorPro { InitializeComponent(); - label1.Text = $"V_EditorPro\nVersion 1.0\nOS: {RuntimeInformation.OSDescription}"; + label1.Text = $"V_EditorPro\nVersion 1.1\nOS: {RuntimeInformation.OSDescription}"; } private void pictureBox1_Click(object sender, EventArgs e) diff --git a/V_EditorPro/MainForm.cs b/V_EditorPro/MainForm.cs index 21ddef4..8dbacd2 100644 --- a/V_EditorPro/MainForm.cs +++ b/V_EditorPro/MainForm.cs @@ -8,13 +8,19 @@ namespace V_EditorPro { public partial class MainForm : Form { - public MainForm() + public MainForm(string filePath = null) { InitializeComponent(); this.KeyPreview = true; this.KeyDown += new KeyEventHandler(MainForm_KeyDown); + + if (!string.IsNullOrEmpty(filePath)) + { + OpenFile(filePath); + } } + private void MainForm_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.O) @@ -53,6 +59,11 @@ namespace V_EditorPro } } + private void OpenFile(string filePath) + { + richTextBox1.Text = File.ReadAllText(filePath); + } + private void OpenFile() { OpenFileDialog openFileDialog = new OpenFileDialog(); @@ -60,7 +71,7 @@ namespace V_EditorPro if (openFileDialog.ShowDialog() == DialogResult.OK) { - richTextBox1.Text = File.ReadAllText(openFileDialog.FileName); + OpenFile(openFileDialog.FileName); } } diff --git a/V_EditorPro/Program.cs b/V_EditorPro/Program.cs index 7f080c3..c449994 100644 --- a/V_EditorPro/Program.cs +++ b/V_EditorPro/Program.cs @@ -13,11 +13,24 @@ namespace V_EditorPro /// Der Haupteinstiegspunkt für die Anwendung. /// [STAThread] - static void Main() + static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); + if (args.Length > 0) + { + // A file was passed as an argument + string filePath = args[0]; + + // Create the main form and pass the file path to it + Application.Run(new MainForm(filePath)); + } + else + { + // No file was passed as an argument + Application.Run(new MainForm()); + + } } } -} +} \ No newline at end of file diff --git a/V_EditorPro/Properties/AssemblyInfo.cs b/V_EditorPro/Properties/AssemblyInfo.cs index e56eeaf..d1e6654 100644 --- a/V_EditorPro/Properties/AssemblyInfo.cs +++ b/V_EditorPro/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0")] -[assembly: AssemblyFileVersion("1.0")] +[assembly: AssemblyVersion("1.1")] +[assembly: AssemblyFileVersion("1.1")] diff --git a/V_EditorProSetup/V_EditorProSetup.vdproj b/V_EditorProSetup/V_EditorProSetup.vdproj index 0f57820..b6d67be 100644 --- a/V_EditorProSetup/V_EditorProSetup.vdproj +++ b/V_EditorProSetup/V_EditorProSetup.vdproj @@ -34,13 +34,13 @@ "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_1A77597F4F993247A0CA6D5211C05EBC" + "OwnerKey" = "8:_A75A53BE905D4A018ADE2B8AC1A2FDC6" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_A75A53BE905D4A018ADE2B8AC1A2FDC6" + "OwnerKey" = "8:_1A77597F4F993247A0CA6D5211C05EBC" "MsmSig" = "8:_UNDEFINED" } } @@ -61,6 +61,14 @@ "PrivateKeyFile" = "8:" "TimeStampServer" = "8:" "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + } } "Release" { @@ -77,6 +85,14 @@ "PrivateKeyFile" = "8:" "TimeStampServer" = "8:" "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + } } } "Deployable" @@ -224,25 +240,25 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:V_EditorPro" - "ProductCode" = "8:{9ABC1146-4460-4B64-8EA7-67A6C84ABD05}" - "PackageCode" = "8:{FA271E47-F355-4580-A852-7CCCB9758C8E}" + "ProductCode" = "8:{64E2E37D-4A9B-437E-9157-AABB371475C4}" + "PackageCode" = "8:{FDC36702-BC29-4516-8565-8D0652AC8033}" "UpgradeCode" = "8:{56851E53-0DA5-4A43-A552-A4F5B5FD39C5}" "AspNetVersion" = "8:2.0.50727.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:1.0" + "ProductVersion" = "8:1.1" "Manufacturer" = "8:abrendan" "ARPHELPTELEPHONE" = "8:" - "ARPHELPLINK" = "8:" + "ARPHELPLINK" = "8:https://www.abrendan.dev" "Title" = "8:V_EditorPro Setup" "Subject" = "8:" "ARPCONTACT" = "8:abrendan" "Keywords" = "8:" "ARPCOMMENTS" = "8:Simple Editor Application" "ARPURLINFOABOUT" = "8:https://www.abrendan.dev" - "ARPPRODUCTICON" = "8:" + "ARPPRODUCTICON" = "8:_D89D93AB9EAB41DA9DF11044540DCF65" "ARPIconIndex" = "3:0" "SearchPath" = "8:" "UseSystemSearchPath" = "11:TRUE" @@ -760,7 +776,7 @@ { "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_A75A53BE905D4A018ADE2B8AC1A2FDC6" { - "SourcePath" = "8:..\\V_EditorPro\\obj\\Debug\\V_EditorPro.exe" + "SourcePath" = "8:..\\V_EditorPro\\obj\\Release\\V_EditorPro.exe" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_5C85C7D260D04E449FC9F8A71E91C827"