HelperAddXMLElementListDataClass Method | |
Create a XML node with list of XML elements from DataClass items and value from parameter list pDataItemList.
This added to XML document as XML node by name from parameter pAddToNode.
Namespace:
SOWIData.XML
Assembly:
SOWIData.XML (in SOWIData.XML.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax public static XmlDocument AddXMLElementList<DataClass>(
this XmlDocument pXMLDocument,
List<Object> pDataItemList,
string pAddToNode = ""
)
<ExtensionAttribute>
Public Shared Function AddXMLElementList(Of DataClass) (
pXMLDocument As XmlDocument,
pDataItemList As List(Of Object),
Optional pAddToNode As String = ""
) As XmlDocument
Parameters
- pXMLDocument
- Type: System.XmlXmlDocument
exist XML document - pDataItemList
- Type: System.Collections.GenericListObject
list of data item object - pAddToNode (Optional)
- Type: SystemString
add to node. Details see AddXMLElement(XmlDocument, XmlElement, String)
Type Parameters
- DataClass
- data class or interface defined which fields to read
Return Value
Type:
XmlDocument[Missing <returns> documentation for "M:SOWIData.XML.Helper.AddXMLElementList``1(System.Xml.XmlDocument,System.Collections.Generic.List{System.Object},System.String)"]
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
XmlDocument. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Remarks
XML node list name is value of DataClass (full name) and .List.
List item element name is value of DataClass (full name).
Examples
This example convert a data type list to a object list
List<object> lListDuWerte = pItem.Anlagekennlinie.DuWerte.Cast<object>().ToList();
lXMLDocument.AddXMLElementList<easyPlanData.Interface.IAnlageKenDuWert>(lListDuWerte, lAddToNodeName);
See Also