From 0e69ee8e0970e854d1e88886e125f6a426b4db54 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Mon, 20 May 2024 19:56:41 +0400 Subject: [PATCH 1/3] Save old value time --- App.config | 3 +++ Form1.Designer.cs | 9 +++------ Properties/Settings.Designer.cs | 12 ++++++++++++ Properties/Settings.settings | 5 ++++- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/App.config b/App.config index 0e382d6..18f8bfa 100644 --- a/App.config +++ b/App.config @@ -29,6 +29,9 @@ False + + 30 + diff --git a/Form1.Designer.cs b/Form1.Designer.cs index 6c9e7c1..afbedd7 100644 --- a/Form1.Designer.cs +++ b/Form1.Designer.cs @@ -1,4 +1,4 @@ -using System.Windows.Forms; +using System.Windows.Forms; namespace Process_Auto_Relaunch { @@ -82,6 +82,7 @@ namespace Process_Auto_Relaunch // // numericUpDown1 // + this.numericUpDown1.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::RelaunchProcess.Properties.Settings.Default, "timer", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.numericUpDown1.Increment = new decimal(new int[] { 5, 0, @@ -103,11 +104,7 @@ namespace Process_Auto_Relaunch this.numericUpDown1.Size = new System.Drawing.Size(72, 22); this.numericUpDown1.TabIndex = 5; this.numericUpDown1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.numericUpDown1.Value = new decimal(new int[] { - 30, - 0, - 0, - 0}); + this.numericUpDown1.Value = global::RelaunchProcess.Properties.Settings.Default.timer; // // label1 // diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs index 1221589..c388999 100644 --- a/Properties/Settings.Designer.cs +++ b/Properties/Settings.Designer.cs @@ -106,5 +106,17 @@ namespace RelaunchProcess.Properties { this["restartNow"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("30")] + public decimal timer { + get { + return ((decimal)(this["timer"])); + } + set { + this["timer"] = value; + } + } } } diff --git a/Properties/Settings.settings b/Properties/Settings.settings index 77ec372..ad9cd31 100644 --- a/Properties/Settings.settings +++ b/Properties/Settings.settings @@ -1,5 +1,5 @@  - + @@ -23,5 +23,8 @@ False + + 30 + \ No newline at end of file From 23ca0506c1f6ee305901d073fb29809148547f31 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Mon, 20 May 2024 19:56:52 +0400 Subject: [PATCH 2/3] Remove debug --- Form1.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Form1.cs b/Form1.cs index c1368bf..a94f200 100644 --- a/Form1.cs +++ b/Form1.cs @@ -186,11 +186,6 @@ namespace Process_Auto_Relaunch var processes = Process.GetProcessesByName(name); foreach (var process in processes) { - if (!process.Responding) - { - MessageBox.Show($" {process.ProcessName} ."); - } - Debug.WriteLine($"Found proces: {process.ProcessName}. Session Id: {process.SessionId}. Current Session Id: {sessionid}"); if (process.SessionId == sessionid) return true; From 5cbae00e0f8db0e8d266fb8e2b6e839e2543dba9 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Mon, 20 May 2024 19:59:36 +0400 Subject: [PATCH 3/3] Update version --- Properties/AssemblyInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 0b13f91..166738f 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Номер сборки // Редакция // -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.2.0.0")] +[assembly: AssemblyFileVersion("1.2.0.0")]