Skip to content

Commit

Permalink
Only get Open With executable on files, removed some old code from wh…
Browse files Browse the repository at this point in the history
…en folder size was calculated every time
  • Loading branch information
Walkman100 committed Feb 27, 2018
1 parent 260456e commit b979b0b
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions PropertiesDotNet.vb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ Public Class PropertiesDotNet
ApplySizeFormatting
imgFile.ImageLocation = FileProperties.FullName

Dim result As String = Space$(1024)
FindExecutable(lblName.Text, lblDirectory.Text & "\", result)
lblOpenWith.Text = Strings.Left$(result, InStr(result, Chr(0)) - 1)
If lblOpenWith.Text = "" Then
lblOpenWith.Text = "Filetype not associated!"
btnStartAssocProg.Enabled = False
btnStartAssocProgAdmin.Enabled = False
Else
btnStartAssocProg.Enabled = True
btnStartAssocProgAdmin.Enabled = True
End If

btnLaunchAdmin.Enabled = True
lblExtensionLbl.Enabled = True
lblExtension.Enabled = True
Expand Down Expand Up @@ -126,18 +138,6 @@ Public Class PropertiesDotNet
btnHashes.Text = "DirectoryImage..."
End If

Dim result As String = Space$(1024)
FindExecutable(lblName.Text, lblDirectory.Text & "\", result)
lblOpenWith.Text = Strings.Left$(result, InStr(result, Chr(0)) - 1)
If lblOpenWith.Text = "" Then
lblOpenWith.Text = "Filetype not associated!"
btnStartAssocProg.Enabled = False
btnStartAssocProgAdmin.Enabled = False
Else
btnStartAssocProg.Enabled = True
btnStartAssocProgAdmin.Enabled = True
End If

If chkUTC.Checked Then
lblCreationTime.Text = GetCreationTimeUtc(lblFullPath.Text)
lblLastAccessTime.Text = GetLastAccessTimeUtc(lblFullPath.Text)
Expand Down Expand Up @@ -760,7 +760,7 @@ Public Class PropertiesDotNet

Sub bwCalcSize_DoWork() Handles bwCalcSize.DoWork
Try
If byteSize = 0 Then cbxSize.Enabled = False
cbxSize.Enabled = False
Dim DirectoryProperties As New DirectoryInfo(lblFullPath.Text)

lblSize.Text = "Getting file list... (May take a while)"
Expand All @@ -774,10 +774,8 @@ Public Class PropertiesDotNet
Next

lblOpenWith.Text = SubFiles.Count
If cbxSize.Enabled = False Then
cbxSize.Enabled = True
AutoDetectSize
End If
cbxSize.Enabled = True
AutoDetectSize
ApplySizeFormatting
Catch ex As Exception
lblSize.Text = "Error: " & ex.Message
Expand Down

0 comments on commit b979b0b

Please sign in to comment.