Rename Shared to Common
This commit is contained in:
43
MultiTool.Common/XmlData.vb
Normal file
43
MultiTool.Common/XmlData.vb
Normal 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
|
||||
Reference in New Issue
Block a user