jj 15.3 geo data zoomlevel

This commit is contained in:
JenneJ
2017-03-15 12:25:14 +01:00
parent d92e9b8586
commit 8f7f9e6cd5
2 changed files with 59 additions and 1 deletions

View File

@@ -184,4 +184,40 @@ Public Class ClassLayout
Return Result
End Function
Public Sub PutValue(Name As String, Value As String)
Dim doc As XDocument = XDocument.Load(_filename)
Dim settings As XElement = doc.Element("Settings")
Dim el As XElement = settings.Descendants("Setting").Where(Function(s)
Return s.Attribute("name") = Name
End Function).SingleOrDefault()
If IsNothing(el) Then
settings.Add(New XElement("Setting",
New XAttribute("name", Name),
New XAttribute("value", Value)))
Else
el.SetAttributeValue("value", Value)
End If
doc.Save(_filename)
End Sub
Public Function GetValue(Name As String) As String
Dim doc As XDocument = XDocument.Load(_filename)
Dim settings As XElement = doc.Element("Settings")
Dim el As XElement = settings.Descendants("Setting").Where(Function(s)
Return s.Attribute("name") = Name
End Function).SingleOrDefault()
If IsNothing(el) Then
Return Nothing
Else
Return el.Attribute("value").Value
End If
End Function
End Class