jj 15.3 geo data zoomlevel
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user