From 084892d790839c75f945233e03ad11d9c22bfeb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=96=91=E2=96=92=E2=96=93=E2=96=88=E2=94=82=E3=80=90Walk?= =?UTF-8?q?man=E3=80=91=E2=94=82=E2=96=88=E2=96=93=E2=96=92=E2=96=91?= Date: Sat, 12 Dec 2015 19:08:44 +0200 Subject: [PATCH] Removed unused code --- KeyInsert.vb | 54 ++++++++++++++++++++++++---------------------------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/KeyInsert.vb b/KeyInsert.vb index 78d5aac..ffff714 100644 --- a/KeyInsert.vb +++ b/KeyInsert.vb @@ -136,37 +136,33 @@ Public Partial Class KeyInsert End Function Sub bwKeyInserter_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles bwKeyInserter.DoWork - If e.Cancel Then - lblStatus.Text = "Cancelling..." - Else - lblStatus.Text = "Running..." - - Do Until DisableKeyPressed - For Each item As ListViewItem In lstKeyStrokes.Items - lblStatus.Text = "Running: " & item.Index - bwKeyInserter.ReportProgress(item.Index) ' workaround for background workers not being able to interact with the UI - - Dim i As Integer - For i = 0 To item.SubItems.Item(1).Text Step 10 - lblStatus.Text = "Waiting: " & item.SubItems.Item(1).Text - i - Threading.Thread.Sleep(10) - If DisableKeyPressed Then Exit Do - Next + lblStatus.Text = "Running..." + + Do Until DisableKeyPressed + For Each item As ListViewItem In lstKeyStrokes.Items + lblStatus.Text = "Running: " & item.Index + bwKeyInserter.ReportProgress(item.Index) ' workaround for background workers not being able to interact with the UI + + Dim i As Integer + For i = 0 To item.SubItems.Item(1).Text Step 10 + lblStatus.Text = "Waiting: " & item.SubItems.Item(1).Text - i + Threading.Thread.Sleep(10) + If DisableKeyPressed Then Exit Do Next - Loop - - Threading.Thread.Sleep(100) - - If chkEndRestore.Checked Then WindowState = FormWindowState.Normal - If chkEndForeground.Checked Then - Me.BringToFront - Me.Focus - Me.Activate - End If - If chkEndShow.Checked Then Me.Show - - lblStatus.Text = "Not Running" + Next + Loop + + Threading.Thread.Sleep(100) + + If chkEndRestore.Checked Then WindowState = FormWindowState.Normal + If chkEndForeground.Checked Then + Me.BringToFront + Me.Focus + Me.Activate End If + If chkEndShow.Checked Then Me.Show + + lblStatus.Text = "Not Running" End Sub Sub bwKeyInserter_ProgressChanged(sender As Object, e As System.ComponentModel.ProgressChangedEventArgs) Handles bwKeyInserter.ProgressChanged