Click or drag to resize

HelperGetXMLElementDataClass Method (XmlDocument, Object)

XML element value store to data item.

Namespace:  SOWIData.XML
Assembly:  SOWIData.XML (in SOWIData.XML.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
public static Object GetXMLElement<DataClass>(
	this XmlDocument pXMLDocument,
	Object pDataItem
)

Parameters

pXMLDocument
Type: System.XmlXmlDocument
exist XML document
pDataItem
Type: SystemObject
data item object

Type Parameters

DataClass
data class or interface defined which fields to read

Return Value

Type: Object

[Missing <returns> documentation for "M:SOWIData.XML.Helper.GetXMLElement``1(System.Xml.XmlDocument,System.Object)"]

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
Examples
This example read XML structure from a stream. Added event handler from event OnGetXMLElementValue. XML values store into data item.
string lContent;
using (System.IO.StreamReader reader = new System.IO.StreamReader(pStream, System.Text.Encoding.Unicode))
{
    lContent = reader.ReadToEnd();
}
var lXMLDocument = new System.Xml.XmlDocument();
lXMLDocument.LoadXml(lContent);

SOWIData.XML.Helper.OnGetXMLElementValue += this.OnGetXMLElementValue;

var lDataItem = this.GetNewDataItem();
string lAddToNodeName = typeof(easyPlanData.Interface.IObjekt).FullName.ToString();

lDataItem = (easyPlanData.Objekt)lXMLDocument.GetXMLElement<easyPlanData.Interface.IObjekt>(lDataItem);
lDataItem.Anlagekennlinie = (easyPlanData.Anlagekennlinie)lXMLDocument.GetXMLElement<easyPlanData.Interface.IAnlagekennlinie>(lDataItem.Anlagekennlinie);

this.ImportItem = lDataItem;
See Also