Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ LoadRowData()

void System.Data.XmlDataLoader.LoadRowData ( DataRow row,
XmlElement rowElement )
inlineprivate

Definition at line 366 of file XmlDataLoader.cs.

367 {
368 DataTable table = row.Table;
369 if (FromInference)
370 {
371 table.Prefix = rowElement.Prefix;
372 }
373 Hashtable hashtable = new Hashtable();
374 row.BeginEdit();
375 XmlNode xmlNode = rowElement.FirstChild;
377 if (textOnlyColumn != null)
378 {
379 hashtable[textOnlyColumn] = textOnlyColumn;
381 if (XMLSchema.GetBooleanAttribute(rowElement, "nil", "http://www.w3.org/2001/XMLSchema-instance", defVal: false) && string.IsNullOrEmpty(valueForTextOnlyColums))
382 {
383 row[textOnlyColumn] = DBNull.Value;
384 }
385 else
386 {
388 }
389 }
390 while (xmlNode != null && xmlNode != rowElement)
391 {
392 if (xmlNode.NodeType == XmlNodeType.Element)
393 {
396 if (obj is DataTable && FColumnElement(xmlElement))
397 {
399 }
400 if (obj == null || obj is DataColumn)
401 {
402 xmlNode = xmlElement.FirstChild;
403 if (obj != null && obj is DataColumn)
404 {
405 DataColumn dataColumn = (DataColumn)obj;
406 if (dataColumn.Table == row.Table && dataColumn.ColumnMapping != MappingType.Attribute && hashtable[dataColumn] == null)
407 {
408 hashtable[dataColumn] = dataColumn;
410 if (XMLSchema.GetBooleanAttribute(xmlElement, "nil", "http://www.w3.org/2001/XMLSchema-instance", defVal: false) && string.IsNullOrEmpty(valueForTextOnlyColums2))
411 {
412 row[dataColumn] = DBNull.Value;
413 }
414 else
415 {
417 }
418 }
419 }
420 else if (obj == null && xmlNode != null)
421 {
422 continue;
423 }
424 if (xmlNode == null)
425 {
427 }
428 }
429 }
430 while (xmlNode != rowElement && xmlNode.NextSibling == null)
431 {
432 xmlNode = xmlNode.ParentNode;
433 }
434 if (xmlNode != rowElement)
435 {
436 xmlNode = xmlNode.NextSibling;
437 }
438 }
439 foreach (XmlAttribute attribute in rowElement.Attributes)
440 {
442 if (columnSchema != null && columnSchema is DataColumn)
443 {
444 DataColumn dataColumn2 = (DataColumn)columnSchema;
445 if (dataColumn2.ColumnMapping == MappingType.Attribute && hashtable[dataColumn2] == null)
446 {
447 hashtable[dataColumn2] = dataColumn2;
448 xmlNode = attribute.FirstChild;
450 }
451 }
452 }
453 foreach (DataColumn column in row.Table.Columns)
454 {
455 if (hashtable[column] != null || !XmlToDatasetMap.IsMappedColumn(column))
456 {
457 continue;
458 }
459 if (!column.AutoIncrement)
460 {
461 if (column.AllowDBNull)
462 {
463 row[column] = DBNull.Value;
464 }
465 else
466 {
467 row[column] = column.DefaultValue;
468 }
469 }
470 else
471 {
472 column.Init(row._tempRecord);
473 }
474 }
475 row.EndEdit();
476 }
bool FColumnElement(XmlElement e)
string GetInitialTextFromNodes(ref XmlNode n)
DataColumn GetTextOnlyColumn(DataRow row)
string GetValueForTextOnlyColums(XmlNode n)
XmlToDatasetMap _nodeToSchemaMap
void SetRowValueFromXmlText(DataRow row, DataColumn col, string xmlText)
bool FIgnoreNamespace(XmlNode node)
object GetSchemaForNode(XmlNode node, bool fIgnoreNamespace)
object GetColumnSchema(XmlNode node, bool fIgnoreNamespace)

References System.Data.XmlDataLoader._nodeToSchemaMap, System.Xml.Dictionary, System.Data.XmlDataLoader.FColumnElement(), System.Data.XmlDataLoader.FIgnoreNamespace(), System.Data.XmlDataLoader.FromInference, System.Data.XMLSchema.GetBooleanAttribute(), System.Data.XmlToDatasetMap.GetColumnSchema(), System.Data.XmlDataLoader.GetInitialTextFromNodes(), System.Data.XmlToDatasetMap.GetSchemaForNode(), System.Data.XmlDataLoader.GetTextOnlyColumn(), System.Data.XmlDataLoader.GetValueForTextOnlyColums(), System.Data.XmlToDatasetMap.IsMappedColumn(), System.obj, System.Data.XmlDataLoader.SetRowValueFromXmlText(), and System.DBNull.Value.

Referenced by System.Data.XmlDataLoader.LoadData(), and System.Data.XmlDataLoader.LoadRows().