Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remember and restore the last policy sources
- Loading branch information
Ben N
committed
Mar 25, 2017
1 parent
b5da020
commit 158d680
Showing
7 changed files
with
851 additions
and
679 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.