Parcourir la source

Add Notify Icon and set version to 1.0.

Gregory il y a 3 ans
Parent
commit
c32df50550

+ 7 - 1
crusherScanner.sln

@@ -3,18 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio Version 17
 VisualStudioVersion = 17.1.32328.378
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "crusherScanner", "crusherScanner\crusherScanner.csproj", "{594D7995-6E4A-44E5-AC36-4E3F544EFF58}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "crusherScanner", "crusherScanner\crusherScanner.csproj", "{594D7995-6E4A-44E5-AC36-4E3F544EFF58}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
+		Debug|x64 = Debug|x64
 		Release|Any CPU = Release|Any CPU
+		Release|x64 = Release|x64
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{594D7995-6E4A-44E5-AC36-4E3F544EFF58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{594D7995-6E4A-44E5-AC36-4E3F544EFF58}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{594D7995-6E4A-44E5-AC36-4E3F544EFF58}.Debug|x64.ActiveCfg = Release|x64
+		{594D7995-6E4A-44E5-AC36-4E3F544EFF58}.Debug|x64.Build.0 = Release|x64
 		{594D7995-6E4A-44E5-AC36-4E3F544EFF58}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{594D7995-6E4A-44E5-AC36-4E3F544EFF58}.Release|Any CPU.Build.0 = Release|Any CPU
+		{594D7995-6E4A-44E5-AC36-4E3F544EFF58}.Release|x64.ActiveCfg = Release|x64
+		{594D7995-6E4A-44E5-AC36-4E3F544EFF58}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 9 - 0
crusherScanner/Form1.Designer.cs

@@ -74,6 +74,7 @@
             this.toolStripProgressBar1 = new System.Windows.Forms.ToolStripProgressBar();
             this.label8 = new System.Windows.Forms.Label();
             this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
+            this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
             this.menuStrip1.SuspendLayout();
             this.statusStrip1.SuspendLayout();
             this.SuspendLayout();
@@ -400,6 +401,13 @@
             this.backgroundWorker1.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork);
             this.backgroundWorker1.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted);
             // 
+            // notifyIcon1
+            // 
+            this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
+            this.notifyIcon1.Text = "Crusher Scanner";
+            this.notifyIcon1.Visible = true;
+            this.notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_DoubleClick);
+            // 
             // Form1
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 25F);
@@ -473,5 +481,6 @@
         private System.ComponentModel.BackgroundWorker backgroundWorker1;
         private ToolStripStatusLabel toolStripStatusLabel4;
         private ToolStripStatusLabel toolStripStatusLabel5;
+        private NotifyIcon notifyIcon1;
     }
 }

+ 19 - 2
crusherScanner/Form1.cs

@@ -15,7 +15,7 @@ namespace crusherScanner
 
         private void Form1_Load(object sender, EventArgs e)
         {
-            Logging.Append(LogLevel.Information,"Crusher Scanner Appliction " + Application.ProductVersion + " is starting.");
+            Logging.Append(LogLevel.Information,"Crusher Scanner Application " + Application.ProductVersion + " is starting.");
             TextBox1.Enabled = false;
             toolStripStatusLabel5.Text = "";
             toolStripStatusLabel2.Text = "0";
@@ -31,7 +31,8 @@ namespace crusherScanner
             dataCore = new ProgramFunctions();
             TextBox1.Enabled = true;
             TextBox1.Focus();
-            Logging.Append(LogLevel.Information,"Crusher Scanner Appliction " + Application.ProductVersion + " has started.");
+            Logging.Append(LogLevel.Information,"Crusher Scanner Application " + Application.ProductVersion + " has started.");
+            notifyIcon1.ShowBalloonTip(30, "Crusher Scanner Application", "Crusher Scanner Application, version " + Application.ProductVersion + " has started.", System.Windows.Forms.ToolTipIcon.Info);
         }
 
         private void TextBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
@@ -231,5 +232,21 @@ namespace crusherScanner
         {
             Logging.PurgeLogs();
         }
+
+        private void notifyIcon1_DoubleClick(object sender, EventArgs e)
+        {
+            // Set the WindowState to normal if the form is minimized.
+            if (this.WindowState == FormWindowState.Minimized)
+            {
+                this.WindowState = FormWindowState.Normal;
+                // Activate the form.
+                this.Activate();
+            }
+            else
+            {
+                this.WindowState = FormWindowState.Minimized;
+            }
+            
+        }
     }
 }

+ 23 - 0
crusherScanner/Form1.resx

@@ -75,7 +75,30 @@
   <metadata name="backgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>846, 17</value>
   </metadata>
+  <metadata name="notifyIcon1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>1076, 17</value>
+  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="notifyIcon1.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        AAABAAEAEBAAAAAAIACpAwAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAPAAAAEAgGAAAAyVYlBAAAA3BJ
+        REFUeJwt091rW2UAx/Hf8zznnLydk8R0W2j6YreFrm7aykA7xM2tbLjagfhynFU2RSxOqcMb2YTREtYL
+        laJ4JQh6obgLKzgqbDfVUdfpRtVaK9SlsWvaupC0yUlO0+Q0eZ7zeDG//8Dn6ksAENxLjo4OdniZ+ryE
+        fLK8UdkVMIIRVVM3VQXTmsczfuqV4c8IIWIYoAnAJcPDwzSRSLifjJ69SBh9R1WYbtsOVFWF5qEQdQHO
+        7wm1Wm3i3NsvmDTSUxwaGqI0kUi4H304+IVh+C9ASj2XKwnuum5A90jbKsMuVWRh3XaTf69yviWP9g+M
+        fCulbAMA8vEHg/2+gPdSpbJVJwTK4j93Sev9zVAowZUrP2M1k8XTfU8gczePcMTgl7+/phStck9pc/Ma
+        BcUbQghXVRm17QpxqnXYpU38MZNEMGTgeO8h6KEQclYJRsggL7/4lHvyuWMdAEBdiS7OXVq2q6yQK0Nl
+        GpLJO8itFdASi6Kwlselr8dxou8QpAv55VfjNLW0HAMAyigJ8rpAOrUGZ7MOURPIZi107d+D5tYdKKwX
+        ETQMbDkVMCpJW1sLwEm7lJJQzt2KlS+DUYbF9ArW1i1si0Sg6z7YxRL0gIHTr55AtCkKn5+S1waeQbRp
+        exchRCo1h087lfphCeFWnS02n1pC7+HHwOsCjlODbvigaBT+gI66A7JRLMjuA/saY40NjyiKRt/3+zxH
+        bi+kQSkFFxxT07Po39kLp8qhG34sp7JYTa9jfj5FvB5VUMqCG8XKKQIAFy8MfFrMl8+MjU+IUFBnc/N3
+        sLO1EQ937hEP7o1jcWGF/Tg1jVzekoRAKEwh4bDxCzFNk731zV7yw7vLlxeSK31/3U5haSUDwQVCIR2P
+        7t+HqZuzsEplMApIAK4LaCoDBYAjJMGlK9+s1bjj83pK4ZDuUErBuTs5O5e66jhb0FQmVUVZ01Rl1u/R
+        bnk09XP8PwbxejWcfLYn2747drP3aHfW69GceDweDIcMdD6wOxOLNrjvnT3dCQCMUgAANU2TApBD514/
+        Xq3W9KamaHckEtrBhVAs61/dKtok3t6ceagjThqbGo6dP//SfY8fPKgAYHRsbMwFgBu//nnr+k8zB3R/
+        YGR5KTMVNgLf5fPVEiEEu5pbJrZvi+R//y05MjeTPjM5OclN08R/s4eJCdHODUcAAAAASUVORK5CYII=
+</value>
+  </data>
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         AAABAAEAEBAAAAAAIACpAwAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAPAAAAEAgGAAAAyVYlBAAAA3BJ

+ 15 - 0
crusherScanner/crusherScanner.csproj

@@ -15,6 +15,11 @@
     <PlatformTarget>x64</PlatformTarget>
     <DelaySign>False</DelaySign>
     <SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion>
+    <Platforms>AnyCPU;x64</Platforms>
+    <AssemblyVersion>1.0.*</AssemblyVersion>
+    <FileVersion>1.0.*</FileVersion>
+	<Deterministic>false</Deterministic>
+	<NeutralLanguage>en-AU</NeutralLanguage>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -22,11 +27,21 @@
     <NoWarn>1701;1702</NoWarn>
   </PropertyGroup>
 
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
+    <NoWarn>1701;1702</NoWarn>
+  </PropertyGroup>
+
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
     <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
     <NoWarn>1701;1702</NoWarn>
   </PropertyGroup>
 
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
+    <NoWarn>1701;1702</NoWarn>
+  </PropertyGroup>
+
   <ItemGroup>
     <AdditionalFiles Remove="app.manifest" />
   </ItemGroup>