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

◆ LoadColumn()

void System.Data.XmlDataLoader.LoadColumn ( DataColumn column,
object[] foundColumns )
inlineprivate

Definition at line 858 of file XmlDataLoader.cs.

859 {
860 string text = string.Empty;
861 string text2 = null;
862 int depth = _dataReader.Depth;
864 {
865 text2 = _dataReader.GetAttribute("nil", "http://www.w3.org/2001/XMLSchema-instance");
866 }
867 if (column.IsCustomType)
868 {
869 object obj = null;
870 string text3 = null;
871 string text4 = null;
874 {
875 text3 = _dataReader.GetAttribute("type", "http://www.w3.org/2001/XMLSchema-instance");
876 text4 = _dataReader.GetAttribute("InstanceType", "urn:schemas-microsoft-com:xml-msdata");
877 }
878 bool flag = !column.ImplementsIXMLSerializable && !(column.DataType == typeof(object)) && text4 == null && text3 == null;
879 if (text2 != null && XmlConvert.ToBoolean(text2))
880 {
881 if (!flag && text4 != null && text4.Length > 0)
882 {
884 }
885 if (obj == null)
886 {
887 obj = DBNull.Value;
888 }
890 {
891 while (_dataReader.Read() && depth < _dataReader.Depth)
892 {
893 }
894 }
896 }
897 else
898 {
899 bool flag2 = false;
900 if (column.Table.DataSet != null && column.Table.DataSet._udtIsWrapped)
901 {
903 flag2 = true;
904 }
905 if (flag)
906 {
907 if (flag2)
908 {
911 }
912 else
913 {
914 xmlRootAttribute = new XmlRootAttribute(column.EncodedColumnName);
916 }
917 }
918 obj = column.ConvertXmlToObject(_dataReader, xmlRootAttribute);
919 if (flag2)
920 {
922 }
923 }
924 foundColumns[column.Ordinal] = obj;
925 return;
926 }
927 if (_dataReader.Read() && depth < _dataReader.Depth)
928 {
929 while (depth < _dataReader.Depth)
930 {
931 switch (_dataReader.NodeType)
932 {
933 case XmlNodeType.Text:
934 case XmlNodeType.CDATA:
935 case XmlNodeType.Whitespace:
936 case XmlNodeType.SignificantWhitespace:
937 if (text.Length == 0)
938 {
942 {
943 if (stringBuilder == null)
944 {
946 }
948 }
949 if (stringBuilder != null)
950 {
951 text = stringBuilder.ToString();
952 }
953 }
954 else
955 {
957 }
958 break;
959 case XmlNodeType.Element:
960 {
961 if (ProcessXsdSchema())
962 {
963 break;
964 }
966 if (columnSchema is DataColumn dataColumn)
967 {
968 if (foundColumns[dataColumn.Ordinal] == null)
969 {
971 }
972 else
973 {
975 }
976 break;
977 }
978 if (columnSchema is DataTable table)
979 {
980 LoadTable(table, isNested: true);
981 break;
982 }
984 if (tableForNode != null)
985 {
987 }
988 else
989 {
991 }
992 break;
993 }
994 case XmlNodeType.EntityReference:
995 throw ExceptionBuilder.FoundEntity();
996 default:
998 break;
999 }
1000 }
1001 _dataReader.Read();
1002 }
1003 if (text.Length == 0 && text2 != null && XmlConvert.ToBoolean(text2))
1004 {
1005 foundColumns[column.Ordinal] = DBNull.Value;
1006 }
1007 else
1008 {
1009 foundColumns[column.Ordinal] = column.ConvertXmlToObject(text);
1010 }
1011 }
static Type GetType(string value)
static object GetStaticNullForUdtType([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields|DynamicallyAccessedMemberTypes.PublicProperties)] Type type)
void LoadTable(DataTable table, bool isNested)
void LoadColumn(DataColumn column, object[] foundColumns)
XmlToDatasetMap _nodeToSchemaMap
bool IsTextLikeNode(XmlNodeType n)
bool FIgnoreNamespace(XmlNode node)
DataTable GetTableForNode(XmlReader node, bool fIgnoreNamespace)
object GetColumnSchema(XmlNode node, bool fIgnoreNamespace)
static bool ToBoolean(string s)
string? GetAttribute(string name)
XmlNodeType NodeType
Definition XmlReader.cs:62
virtual string ReadString()
Definition XmlReader.cs:570

References System.Data.XmlDataLoader._dataReader, System.Data.XmlDataLoader._nodeToSchemaMap, System.Xml.XmlReader.AttributeCount, System.Xml.XmlReader.Depth, System.Xml.Dictionary, System.Data.XmlDataLoader.FIgnoreNamespace(), System.Data.ExceptionBuilder.FoundEntity(), System.Xml.XmlReader.GetAttribute(), System.Data.XmlToDatasetMap.GetColumnSchema(), System.Data.Common.SqlUdtStorage.GetStaticNullForUdtType(), System.Data.XmlToDatasetMap.GetTableForNode(), System.Data.Common.DataStorage.GetType(), System.Xml.XmlReader.IsEmptyElement, System.Data.XmlDataLoader.IsTextLikeNode(), System.Data.XmlDataLoader.LoadColumn(), System.Data.XmlDataLoader.LoadTable(), System.Xml.XmlReader.LocalName, System.Xml.XmlReader.NamespaceURI, System.Xml.XmlReader.NodeType, System.obj, System.Data.XmlDataLoader.ProcessXsdSchema(), System.Xml.XmlReader.Read(), System.Xml.XmlReader.ReadString(), System.text, System.Xml.XmlConvert.ToBoolean(), System.DBNull.Value, and System.Xml.XmlReader.Value.

Referenced by System.Data.XmlDataLoader.LoadColumn(), System.Data.XmlDataLoader.LoadTable(), and System.Data.XmlDataLoader.LoadTopMostTable().