From c0b2b10f01a8ed0a10867758ff1c49a72abf1966 Mon Sep 17 00:00:00 2001 From: ImminentFate Date: Tue, 24 Oct 2017 16:00:18 +1000 Subject: [PATCH] Tidied up shutdown display. Fixed counter offset to accommodate for load time --- WindowsApp1/Compact.vb | 2 +- WindowsApp1/My Project/AssemblyInfo.vb | 4 ++-- WindowsApp1/ShutdownDialog.Designer.vb | 2 -- WindowsApp1/ShutdownDialog.vb | 11 +++++++++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/WindowsApp1/Compact.vb b/WindowsApp1/Compact.vb index b08fbb9..07e0277 100644 --- a/WindowsApp1/Compact.vb +++ b/WindowsApp1/Compact.vb @@ -7,7 +7,7 @@ Imports System.Management Public Class Compact - Dim version = "1.6.0" + Dim version = "1.7.0" Private WithEvents MyProcess As Process Private Delegate Sub AppendOutputTextDelegate(ByVal text As String) diff --git a/WindowsApp1/My Project/AssemblyInfo.vb b/WindowsApp1/My Project/AssemblyInfo.vb index 4a809a1..3d573b2 100644 --- a/WindowsApp1/My Project/AssemblyInfo.vb +++ b/WindowsApp1/My Project/AssemblyInfo.vb @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + diff --git a/WindowsApp1/ShutdownDialog.Designer.vb b/WindowsApp1/ShutdownDialog.Designer.vb index fe108f4..2ddb2a3 100644 --- a/WindowsApp1/ShutdownDialog.Designer.vb +++ b/WindowsApp1/ShutdownDialog.Designer.vb @@ -84,9 +84,7 @@ Partial Class ShutdownDialog Me.SDProgText.Name = "SDProgText" Me.SDProgText.Size = New System.Drawing.Size(304, 25) Me.SDProgText.TabIndex = 1 - Me.SDProgText.Text = "Shutting down in 10 seconds" Me.SDProgText.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.SDProgText.Visible = False ' 'Panel1 ' diff --git a/WindowsApp1/ShutdownDialog.vb b/WindowsApp1/ShutdownDialog.vb index f2999e7..bfad5e7 100644 --- a/WindowsApp1/ShutdownDialog.vb +++ b/WindowsApp1/ShutdownDialog.vb @@ -12,10 +12,17 @@ Public Class ShutdownDialog Private Sub Dialog1_Load(sender As Object, e As EventArgs) Handles MyBase.Load shutdownTimer.Start() - + Select Case SDProcIntent.Text + Case "Shutdown" + SDProgText.Text = "Shutting down in 10 seconds" + Case "Restart" + SDProgText.Text = "Restarting in 10 seconds" + Case "Sleep" + SDProgText.Text = "Sleeping in 10 seconds" + End Select End Sub - Dim secCount As Integer = 10 + Dim secCount As Integer = 9 Private Sub shutdownTimer_Tick(sender As Object, e As EventArgs) Handles shutdownTimer.Tick Select Case SDProcIntent.Text