From 0047227b0059183198602cef74da83db44a62039 Mon Sep 17 00:00:00 2001
From: Adam Thorn <alt36@cam.ac.uk>
Date: Wed, 10 Jun 2020 17:12:12 +0100
Subject: [PATCH] tidyup per VS suggestions

---
 WpkgInstaller/WpkgInstaller.cs | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/WpkgInstaller/WpkgInstaller.cs b/WpkgInstaller/WpkgInstaller.cs
index cf38bd4..0fe6783 100755
--- a/WpkgInstaller/WpkgInstaller.cs
+++ b/WpkgInstaller/WpkgInstaller.cs
@@ -52,10 +52,12 @@ namespace WpkgInstaller
 
         protected override void OnStart(string[] args)
         {
-            
-            ServiceStatus serviceStatus = new ServiceStatus();
-            serviceStatus.dwCurrentState = ServiceState.SERVICE_START_PENDING;
-            serviceStatus.dwWaitHint = 100000;
+
+            ServiceStatus serviceStatus = new ServiceStatus
+            {
+                dwCurrentState = ServiceState.SERVICE_START_PENDING,
+                dwWaitHint = 100000
+            };
             SetServiceStatus(this.ServiceHandle, ref serviceStatus);
 
             serviceStatus.dwCurrentState = ServiceState.SERVICE_RUNNING;
@@ -66,9 +68,11 @@ namespace WpkgInstaller
 
         protected override void OnStop()
         {
-            ServiceStatus serviceStatus = new ServiceStatus();
-            serviceStatus.dwCurrentState = ServiceState.SERVICE_STOP_PENDING;
-            serviceStatus.dwWaitHint = 100000;
+            ServiceStatus serviceStatus = new ServiceStatus
+            {
+                dwCurrentState = ServiceState.SERVICE_STOP_PENDING,
+                dwWaitHint = 100000
+            };
             SetServiceStatus(this.ServiceHandle, ref serviceStatus);
 
             serviceStatus.dwCurrentState = ServiceState.SERVICE_STOPPED;
-- 
GitLab