Skip to content

Commit

Permalink
Remember and restore the last policy sources
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben N committed Mar 25, 2017
1 parent b5da020 commit 158d680
Show file tree
Hide file tree
Showing 7 changed files with 851 additions and 679 deletions.
20 changes: 20 additions & 0 deletions PolicyPlus/ConfigurationStorage.vb
@@ -0,0 +1,20 @@
Imports Microsoft.Win32
Public Class ConfigurationStorage
Dim ConfigKey As RegistryKey
Public Sub New(RegistryBase As RegistryHive, Subkey As String)
Try
ConfigKey = RegistryKey.OpenBaseKey(RegistryBase, RegistryView.Default).CreateSubKey(Subkey)
Catch ex As Exception
' The key couldn't be created
End Try
End Sub
Public Function GetValue(ValueName As String, DefaultValue As Object) As Object
If ConfigKey IsNot Nothing Then Return ConfigKey.GetValue(ValueName, DefaultValue) Else Return DefaultValue
End Function
Public Sub SetValue(ValueName As String, Data As Object)
If ConfigKey IsNot Nothing Then ConfigKey.SetValue(ValueName, Data)
End Sub
Public Function HasValue(ValueName As String) As Boolean
Return ConfigKey.GetValue(ValueName) IsNot Nothing
End Function
End Class
58 changes: 53 additions & 5 deletions PolicyPlus/Main.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 158d680

Please sign in to comment.