Skip to content

Commit

Permalink
Added reading all settings from config
Browse files Browse the repository at this point in the history
  • Loading branch information
Walkman100 committed Dec 12, 2015
1 parent 084892d commit 2b6c137
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions KeyInsert.vb
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,15 @@ Public Partial Class KeyInsert
MsgBox("Reading config failed! The error was: " & ex.ToString, MsgBoxStyle.Critical)
Exit Sub
End Try
Dim attribute As String

If reader.IsStartElement() AndAlso reader.Name = "KeyInsert" Then
If reader.Read AndAlso reader.IsStartElement() AndAlso reader.Name = "KeyList" Then
While reader.IsStartElement
If reader.Read AndAlso reader.IsStartElement() AndAlso reader.Name = "KeyString" Then
Dim tmpListViewItem As New ListViewItem(New String() {"{ENTER}", "100"})

Dim attribute As String = reader("keys")
attribute = reader("keys")
If attribute IsNot Nothing Then
tmpListViewItem.Text = attribute
End If
Expand All @@ -201,7 +202,6 @@ Public Partial Class KeyInsert
End If
If reader.Read AndAlso reader.IsStartElement() AndAlso reader.Name = "Settings" Then
If reader.Read AndAlso reader.IsStartElement() AndAlso reader.Name = "ColumnSettings" Then
Dim attribute As String
While reader.IsStartElement
If reader.Read AndAlso reader.IsStartElement() Then
If reader.Name = "KeyStrings" Then
Expand All @@ -228,6 +228,29 @@ Public Partial Class KeyInsert
End If
End While
End If

Do While reader.Read AndAlso reader.IsStartElement
Select Case reader.Name
Case "StopKey"
attribute = reader("key")
Select Case attribute
Case "ctrl"
optKeyCtrl.Checked = True
Case "alt"
optKeyAlt.Checked = True
Case "shift"
optKeyShift.Checked = True
End Select
Case "StartActions"
chkStartMinimise.Checked = reader("minimise")
chkStartBackground.Checked = reader("background")
chkStartHide.Checked = reader("hide")
Case "EndActions"
chkEndRestore.Checked = reader("restore")
chkEndForeground.Checked = reader("foreground")
chkEndRestore.Checked = reader("show")
End Select
Loop
End If
End If

Expand Down

0 comments on commit 2b6c137

Please sign in to comment.