Change Name to MultiTool

This commit is contained in:
Jonathan Jenne
2021-10-29 10:37:04 +02:00
parent f00e332737
commit 1035a0fb1f
121 changed files with 186 additions and 185 deletions

View File

@@ -0,0 +1,43 @@
Imports DigitalData.Modules.Logging
Public Class XmlData
'<DebuggerStepThrough>
Public Shared Function GetElementAttribute(pElement As XElement, pName As String) As String
Try
Dim oAttribute As XAttribute = pElement.Attribute(pName)
Return oAttribute?.Value
Catch ex As Exception
Return Nothing
End Try
End Function
Public Shared Function GetElementsFromElement(pElement As XContainer, pElementName As String) As List(Of XElement)
Return pElement.Descendants(pElementName).
Elements().
ToList()
End Function
Public Shared Function GetElementsFromElement(pElement As XContainer, pElementName As String, pNamespace As XNamespace) As List(Of XElement)
Return pElement.Descendants(pNamespace + pElementName).
Elements().
ToList()
End Function
Public Shared Function GetElement(pContainer As XContainer, pElementName As String, pNamespace As XNamespace) As XElement
Return pContainer.Descendants(pNamespace + pElementName).
FirstOrDefault()
End Function
Public Shared Function GetElement(pContainer As XContainer, pElementName As String) As XElement
Return pContainer.Descendants(pElementName).
FirstOrDefault()
End Function
Public Shared Function GetElementValue(pElement As XElement) As String
Return pElement.Value
End Function
End Class