Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XSDSchema.cs
Go to the documentation of this file.
7using System.Xml;
9
10namespace System.Data;
11
12internal sealed class XSDSchema : XMLSchema
13{
14 private sealed class NameType : IComparable
15 {
16 public readonly string name;
17
19 public readonly Type type;
20
22 {
23 name = n;
24 type = t;
25 }
26
27 public int CompareTo(object obj)
28 {
29 return string.Compare(name, (string)obj, StringComparison.Ordinal);
30 }
31 }
32
34
36
37 private DataSet _ds;
38
39 private string _schemaName;
40
42
44
46
48
50
52
54
56
58
60
62
64
66
68
69 private bool _fromInference;
70
71 private static readonly NameType[] s_mapNameTypeXsd = new NameType[44]
72 {
73 new NameType("ENTITIES", typeof(string)),
74 new NameType("ENTITY", typeof(string)),
75 new NameType("ID", typeof(string)),
76 new NameType("IDREF", typeof(string)),
77 new NameType("IDREFS", typeof(string)),
78 new NameType("NCName", typeof(string)),
79 new NameType("NMTOKEN", typeof(string)),
80 new NameType("NMTOKENS", typeof(string)),
81 new NameType("NOTATION", typeof(string)),
82 new NameType("Name", typeof(string)),
83 new NameType("QName", typeof(string)),
84 new NameType("anyType", typeof(object)),
85 new NameType("anyURI", typeof(Uri)),
86 new NameType("base64Binary", typeof(byte[])),
87 new NameType("boolean", typeof(bool)),
88 new NameType("byte", typeof(sbyte)),
89 new NameType("date", typeof(DateTime)),
90 new NameType("dateTime", typeof(DateTime)),
91 new NameType("decimal", typeof(decimal)),
92 new NameType("double", typeof(double)),
93 new NameType("duration", typeof(TimeSpan)),
94 new NameType("float", typeof(float)),
95 new NameType("gDay", typeof(DateTime)),
96 new NameType("gMonth", typeof(DateTime)),
97 new NameType("gMonthDay", typeof(DateTime)),
98 new NameType("gYear", typeof(DateTime)),
99 new NameType("gYearMonth", typeof(DateTime)),
100 new NameType("hexBinary", typeof(byte[])),
101 new NameType("int", typeof(int)),
102 new NameType("integer", typeof(long)),
103 new NameType("language", typeof(string)),
104 new NameType("long", typeof(long)),
105 new NameType("negativeInteger", typeof(long)),
106 new NameType("nonNegativeInteger", typeof(ulong)),
107 new NameType("nonPositiveInteger", typeof(long)),
108 new NameType("normalizedString", typeof(string)),
109 new NameType("positiveInteger", typeof(ulong)),
110 new NameType("short", typeof(short)),
111 new NameType("string", typeof(string)),
112 new NameType("time", typeof(DateTime)),
113 new NameType("unsignedByte", typeof(byte)),
114 new NameType("unsignedInt", typeof(uint)),
115 new NameType("unsignedLong", typeof(ulong)),
116 new NameType("unsignedShort", typeof(ushort))
117 };
118
119 internal bool FromInference
120 {
121 get
122 {
123 return _fromInference;
124 }
125 set
126 {
128 }
129 }
130
137
139 {
141 {
142 return;
143 }
145 foreach (XmlSchemaObject item in schema.Items)
146 {
148 {
150 }
152 {
156 }
158 {
161 }
163 {
166 }
167 if (!(item is XmlSchemaType))
168 {
169 continue;
170 }
171 string text = null;
173 {
174 text = GetMsdataAttribute((XmlSchemaType)item, "targetNamespace");
175 }
179 {
180 continue;
181 }
182 if (_udSimpleTypes == null)
183 {
185 }
186 _udSimpleTypes[xmlSchemaType.QualifiedName.ToString()] = xmlSchemaSimpleType;
188 if (simpleType != null)
189 {
191 string text2 = simpleType.HasConflictingDefinition(simpleType2);
192 if (text2.Length != 0)
193 {
195 }
196 }
197 }
198 foreach (XmlSchemaExternal include in schema.Includes)
199 {
200 if (!(include is XmlSchemaImport) && include.Schema != null)
201 {
203 }
204 }
205 }
206
207 internal static string QualifiedName(string name)
208 {
209 if (!name.Contains(':'))
210 {
211 return "xs:" + name;
212 }
213 return name;
214 }
215
216 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
217 internal static void SetProperties(object instance, XmlAttribute[] attrs)
218 {
219 if (attrs == null)
220 {
221 return;
222 }
223 for (int i = 0; i < attrs.Length; i++)
224 {
225 if (!(attrs[i].NamespaceURI == "urn:schemas-microsoft-com:xml-msdata"))
226 {
227 continue;
228 }
229 string localName = attrs[i].LocalName;
230 string value = attrs[i].Value;
231 switch (localName)
232 {
233 case "Expression":
234 if (instance is DataColumn)
235 {
236 continue;
237 }
238 break;
239 case "DefaultValue":
240 case "Ordinal":
241 case "Locale":
242 case "RemotingFormat":
243 continue;
244 }
245 if (localName == "DataType")
246 {
247 if (instance is DataColumn dataColumn)
248 {
250 }
251 continue;
252 }
254 if (propertyDescriptor == null)
255 {
256 continue;
257 }
258 Type propertyType = propertyDescriptor.PropertyType;
260 object value2;
261 if (converter.CanConvertFrom(typeof(string)))
262 {
263 value2 = converter.ConvertFromInvariantString(value);
264 }
265 else if (propertyType == typeof(Type))
266 {
268 }
269 else
270 {
272 {
274 }
275 value2 = new CultureInfo(value);
276 }
277 propertyDescriptor.SetValue(instance, value2);
278 }
279 }
280
281 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
282 private static void SetExtProperties(object instance, XmlAttribute[] attrs)
283 {
285 if (attrs == null)
286 {
287 return;
288 }
289 for (int i = 0; i < attrs.Length; i++)
290 {
291 if (!(attrs[i].NamespaceURI == "urn:schemas-microsoft-com:xml-msprop"))
292 {
293 continue;
294 }
295 if (propertyCollection == null)
296 {
297 object value = TypeDescriptor.GetProperties(instance)["ExtendedProperties"].GetValue(instance);
299 }
300 string text = XmlConvert.DecodeName(attrs[i].LocalName);
301 if (instance is ForeignKeyConstraint)
302 {
303 if (!text.StartsWith("fk_", StringComparison.Ordinal))
304 {
305 continue;
306 }
307 text = text.Substring(3);
308 }
309 if (instance is DataRelation && text.StartsWith("rel_", StringComparison.Ordinal))
310 {
311 text = text.Substring(4);
312 }
313 else if (instance is DataRelation && text.StartsWith("fk_", StringComparison.Ordinal))
314 {
315 continue;
316 }
317 propertyCollection.Add(text, attrs[i].Value);
318 }
319 }
320
321 private void HandleColumnExpression(object instance, XmlAttribute[] attrs)
322 {
323 if (attrs == null || !(instance is DataColumn dataColumn))
324 {
325 return;
326 }
327 for (int i = 0; i < attrs.Length; i++)
328 {
329 if (attrs[i].NamespaceURI == "urn:schemas-microsoft-com:xml-msdata" && attrs[i].LocalName == "Expression")
330 {
331 if (_expressions == null)
332 {
333 _expressions = new Hashtable();
334 }
335 _expressions[dataColumn] = attrs[i].Value;
337 break;
338 }
339 }
340 }
341
342 internal static string GetMsdataAttribute(XmlSchemaAnnotated node, string ln)
343 {
344 XmlAttribute[] unhandledAttributes = node.UnhandledAttributes;
345 if (unhandledAttributes != null)
346 {
347 for (int i = 0; i < unhandledAttributes.Length; i++)
348 {
349 if (unhandledAttributes[i].LocalName == ln && unhandledAttributes[i].NamespaceURI == "urn:schemas-microsoft-com:xml-msdata")
350 {
351 return unhandledAttributes[i].Value;
352 }
353 }
354 }
355 return null;
356 }
357
358 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
359 private static void SetExtProperties(object instance, XmlAttributeCollection attrs)
360 {
362 for (int i = 0; i < attrs.Count; i++)
363 {
364 if (attrs[i].NamespaceURI == "urn:schemas-microsoft-com:xml-msprop")
365 {
366 if (propertyCollection == null)
367 {
368 object value = TypeDescriptor.GetProperties(instance)["ExtendedProperties"].GetValue(instance);
370 }
371 string key = XmlConvert.DecodeName(attrs[i].LocalName);
372 propertyCollection.Add(key, attrs[i].Value);
373 }
374 }
375 }
376
377 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
385
386 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
388 {
389 bool createConstraints = false;
391 string text = XmlConvert.DecodeName(node.GetAttribute("name"));
392 for (int i = 0; i < relations.Count; i++)
393 {
394 if (string.Equals(relations[i].RelationName, text, StringComparison.Ordinal))
395 {
396 return;
397 }
398 }
399 string attribute = node.GetAttribute("parent", "urn:schemas-microsoft-com:xml-msdata");
400 if (attribute == null || attribute.Length == 0)
401 {
403 }
405 string attribute2 = node.GetAttribute("child", "urn:schemas-microsoft-com:xml-msdata");
406 if (attribute2 == null || attribute2.Length == 0)
407 {
409 }
411 string attribute3 = node.GetAttribute("parentkey", "urn:schemas-microsoft-com:xml-msdata");
412 if (attribute3 == null || attribute3.Length == 0)
413 {
415 }
416 string[] array = attribute3.TrimEnd(null).Split(' ', '+');
417 attribute3 = node.GetAttribute("childkey", "urn:schemas-microsoft-com:xml-msdata");
418 if (attribute3 == null || attribute3.Length == 0)
419 {
421 }
422 string[] array2 = attribute3.TrimEnd(null).Split(' ', '+');
423 int num = array.Length;
424 if (num != array2.Length)
425 {
427 }
428 DataColumn[] array3 = new DataColumn[num];
429 DataColumn[] array4 = new DataColumn[num];
430 string attribute4 = node.GetAttribute("ParentTableNamespace", "urn:schemas-microsoft-com:xml-msdata");
431 string attribute5 = node.GetAttribute("ChildTableNamespace", "urn:schemas-microsoft-com:xml-msdata");
433 if (tableSmart == null)
434 {
436 }
438 if (tableSmart2 == null)
439 {
441 }
442 for (int j = 0; j < num; j++)
443 {
445 if (array3[j] == null)
446 {
448 }
450 if (array4[j] == null)
451 {
453 }
454 }
459 if (FromInference && dataRelation.Nested)
460 {
461 _tableDictionary[dataRelation.ParentTable].Add(dataRelation.ChildTable);
462 }
463 }
464
466 {
467 foreach (XmlSchemaObject attribute in attributes)
468 {
470 {
471 return true;
472 }
474 {
475 return true;
476 }
478 {
479 return true;
480 }
481 }
482 return false;
483 }
484
486 {
488 if (particleItems == null)
489 {
490 return false;
491 }
492 bool flag = FromInference && pt is XmlSchemaChoice;
494 {
496 {
497 if (flag && pt.MaxOccurs > 1m && ((XmlSchemaElement)item).SchemaType is XmlSchemaComplexType)
498 {
499 ((XmlSchemaElement)item).MaxOccurs = pt.MaxOccurs;
500 }
501 if ((((XmlSchemaElement)item).RefName.Name.Length == 0 || (FromInference && (!(((XmlSchemaElement)item).MaxOccurs != 1m) || ((XmlSchemaElement)item).SchemaType is XmlSchemaComplexType))) && !IsTable((XmlSchemaElement)item))
502 {
503 return false;
504 }
505 }
507 {
508 return false;
509 }
510 }
511 return true;
512 }
513
515 {
516 int num = 0;
517 foreach (XmlSchemaElement element in elements)
518 {
519 if (GetBooleanAttribute(element, "IsDataSet", defVal: false))
520 {
521 num++;
522 }
523 }
524 return num;
525 }
526
528 {
529 foreach (XmlSchemaElement element in elements)
530 {
531 if (GetBooleanAttribute(element, "IsDataSet", defVal: false))
532 {
533 return element;
534 }
535 }
536 if (elements.Count == 1 || (FromInference && elements.Count > 0))
537 {
539 if (!GetBooleanAttribute(xmlSchemaElement2, "IsDataSet", defVal: true))
540 {
541 return null;
542 }
544 if (xmlSchemaComplexType == null)
545 {
546 return null;
547 }
548 while (xmlSchemaComplexType != null)
549 {
550 if (HasAttributes(xmlSchemaComplexType.Attributes))
551 {
552 return null;
553 }
555 {
556 XmlSchemaAnnotated content = ((XmlSchemaSimpleContent)xmlSchemaComplexType.ContentModel).Content;
558 {
561 {
562 return null;
563 }
564 }
565 else
566 {
569 {
570 return null;
571 }
572 }
573 }
575 if (particle != null && !IsDatasetParticle(particle))
576 {
577 return null;
578 }
579 if (!(xmlSchemaComplexType.BaseXmlSchemaType is XmlSchemaComplexType))
580 {
581 break;
582 }
584 }
585 return xmlSchemaElement2;
586 }
587 return null;
588 }
589
590 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
592 {
593 if (dt.DataSet != null)
594 {
595 LoadSchema(schemaSet, dt.DataSet);
596 }
597 }
598
599 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
601 {
603 _refTables = new ArrayList();
605 _complexTypes = new ArrayList();
606 bool flag = false;
607 bool isNewDataSet = ds.Tables.Count == 0;
608 if (schemaSet == null)
609 {
610 return;
611 }
613 _ds = ds;
616 try
617 {
618 if (enumerator.MoveNext())
619 {
622 if (_schemaName == null || _schemaName.Length == 0)
623 {
624 _schemaName = "NewDataSet";
625 }
627 string targetNamespace = xmlSchema.TargetNamespace;
628 if (ds._namespaceURI == null || ds._namespaceURI.Length == 0)
629 {
630 ds._namespaceURI = ((targetNamespace == null) ? string.Empty : targetNamespace);
631 }
632 }
633 }
634 finally
635 {
637 if (disposable != null)
638 {
639 disposable.Dispose();
640 }
641 }
645 _attributes = new Hashtable();
647 _schemaTypes = new Hashtable();
650 foreach (DataTable table in ds.Tables)
651 {
652 foreach (DataColumn column in table.Columns)
653 {
654 if (column.SimpleType != null && column.SimpleType.Name != null && column.SimpleType.Name.Length != 0)
655 {
656 _existingSimpleTypeMap[column.SimpleType.SimpleTypeQualifiedName] = column;
657 }
658 }
659 }
660 foreach (XmlSchema item in schemaSet.Schemas())
661 {
663 }
665 if (_dsElement != null)
666 {
667 string stringAttribute = GetStringAttribute(_dsElement, "MainDataTable", "");
668 if (stringAttribute != null)
669 {
671 }
672 }
673 else
674 {
675 if (FromInference)
676 {
677 ds._fTopLevelTable = true;
678 }
679 flag = true;
680 }
682 if (ds != null && ds._useDataSetSchemaOnly)
683 {
685 if (num == 0)
686 {
688 }
689 if (num > 1)
690 {
692 }
694 if (xmlSchemaComplexType.Particle != null)
695 {
697 if (particleItems != null)
698 {
700 {
701 if (item2 is XmlSchemaElement xmlSchemaElement && xmlSchemaElement.RefName.Name.Length != 0)
702 {
703 list.Add(xmlSchemaElement.QualifiedName);
704 }
705 }
706 }
707 }
708 }
709 foreach (XmlSchemaElement element in _elements)
710 {
711 if (element != _dsElement && (ds == null || !ds._useDataSetSchemaOnly || _dsElement == null || _dsElement.Parent == element.Parent || list.Contains(element.QualifiedName)))
712 {
713 string instanceName = GetInstanceName(element);
715 {
717 }
718 else
719 {
720 HandleTable(element);
721 }
722 }
723 }
724 if (_dsElement != null)
725 {
727 }
728 foreach (XmlSchemaAnnotation annotation in _annotations)
729 {
730 HandleRelations(annotation, fNested: false);
731 }
732 for (int i = 0; i < _columnExpressions.Count; i++)
733 {
736 }
737 foreach (DataTable table2 in ds.Tables)
738 {
739 if (table2.NestedParentRelations.Length != 0 || !(table2.Namespace == ds.Namespace))
740 {
741 continue;
742 }
744 for (int j = 0; j < childRelations.Count; j++)
745 {
746 if (childRelations[j].Nested && table2.Namespace == childRelations[j].ChildTable.Namespace)
747 {
748 childRelations[j].ChildTable._tableNamespace = null;
749 }
750 }
752 }
753 DataTable dataTable3 = ds.Tables[ds.DataSetName, ds.Namespace];
754 if (dataTable3 != null)
755 {
757 }
758 if (FromInference && ds.Tables.Count == 0 && string.Equals(ds.DataSetName, "NewDataSet", StringComparison.Ordinal))
759 {
761 }
762 ds._fIsSchemaLoading = false;
763 if (!flag)
764 {
765 return;
766 }
767 if (ds.Tables.Count > 0)
768 {
769 ds.Namespace = ds.Tables[0].Namespace;
770 ds.Prefix = ds.Tables[0].Prefix;
771 return;
772 }
773 foreach (XmlSchema item3 in schemaSet.Schemas())
774 {
775 ds.Namespace = item3.TargetNamespace;
776 }
777 }
778
779 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
781 {
782 foreach (XmlSchemaObject item in ann.Items)
783 {
784 if (!(item is XmlSchemaAppInfo))
785 {
786 continue;
787 }
788 XmlNode[] markup = ((XmlSchemaAppInfo)item).Markup;
789 for (int i = 0; i < markup.Length; i++)
790 {
791 if (XMLSchema.FEqualIdentity(markup[i], "Relationship", "urn:schemas-microsoft-com:xml-msdata"))
792 {
794 }
795 }
796 }
797 }
798
800 {
802 {
803 return ((XmlSchemaSequence)pt).Items;
804 }
805 if (pt is XmlSchemaAll)
806 {
807 return ((XmlSchemaAll)pt).Items;
808 }
810 {
811 return ((XmlSchemaChoice)pt).Items;
812 }
813 if (pt is XmlSchemaAny)
814 {
815 return null;
816 }
818 {
822 }
824 {
825 return GetParticleItems(((XmlSchemaGroupRef)pt).Particle);
826 }
827 return null;
828 }
829
830 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
832 {
834 if (particleItems == null)
835 {
836 return;
837 }
839 {
841 {
842 if (FromInference && pt is XmlSchemaChoice && pt.MaxOccurs > 1m && xmlSchemaElement.SchemaType is XmlSchemaComplexType)
843 {
844 xmlSchemaElement.MaxOccurs = pt.MaxOccurs;
845 }
846 DataTable dataTable = null;
847 if ((xmlSchemaElement.Name == null && xmlSchemaElement.RefName.Name == table.EncodedTableName && xmlSchemaElement.RefName.Namespace == table.Namespace) || (IsTable(xmlSchemaElement) && xmlSchemaElement.Name == table.TableName))
848 {
850 }
851 else
852 {
854 if (dataTable == null && FromInference && xmlSchemaElement.Name == table.TableName)
855 {
856 dataTable = table;
857 }
858 }
859 if (dataTable == null)
860 {
861 if (!FromInference || xmlSchemaElement.Name != table.TableName)
862 {
864 }
865 continue;
866 }
868 if (xmlSchemaElement.Annotation != null)
869 {
870 HandleRelations(xmlSchemaElement.Annotation, fNested: true);
871 }
873 for (int i = 0; i < childRelations.Count; i++)
874 {
875 if (childRelations[i].Nested && dataTable == childRelations[i].ChildTable)
876 {
878 }
879 }
880 if (dataRelation != null)
881 {
882 continue;
883 }
886 {
887 continue;
888 }
889 int num = -1;
890 foreach (DataColumn column in table.Columns)
891 {
892 if (column.ColumnMapping == MappingType.Element)
893 {
894 num++;
895 }
896 }
898 }
899 else
900 {
902 }
903 }
904 }
905
906 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
923
924 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
942
943 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
945 {
947 {
949 }
950 bool isBase = false;
952 if (ct.ContentModel != null)
953 {
954 if (ct.ContentModel is XmlSchemaComplexContent)
955 {
956 XmlSchemaAnnotated content = ((XmlSchemaComplexContent)ct.ContentModel).Content;
958 {
960 if (!(ct.BaseXmlSchemaType is XmlSchemaComplexType) || !FromInference)
961 {
963 }
964 if (ct.BaseXmlSchemaType is XmlSchemaComplexType)
965 {
967 }
968 else if (xmlSchemaComplexContentExtension.BaseTypeName.Namespace != "http://www.w3.org/2001/XMLSchema")
969 {
970 HandleSimpleContentColumn(xmlSchemaComplexContentExtension.BaseTypeName.ToString(), table, isBase, ct.ContentModel.UnhandledAttributes, isNillable);
971 }
972 else
973 {
974 HandleSimpleContentColumn(xmlSchemaComplexContentExtension.BaseTypeName.Name, table, isBase, ct.ContentModel.UnhandledAttributes, isNillable);
975 }
976 if (xmlSchemaComplexContentExtension.Particle != null)
977 {
979 }
980 if (ct.BaseXmlSchemaType is XmlSchemaComplexType && FromInference)
981 {
983 }
984 }
985 else
986 {
988 if (!FromInference)
989 {
991 }
992 if (xmlSchemaComplexContentRestriction.Particle != null)
993 {
995 }
996 if (FromInference)
997 {
999 }
1000 }
1001 }
1002 else
1003 {
1004 XmlSchemaAnnotated content2 = ((XmlSchemaSimpleContent)ct.ContentModel).Content;
1006 {
1009 if (ct.BaseXmlSchemaType is XmlSchemaComplexType)
1010 {
1012 }
1013 else
1014 {
1015 HandleSimpleTypeSimpleContentColumn((XmlSchemaSimpleType)ct.BaseXmlSchemaType, xmlSchemaSimpleContentExtension.BaseTypeName.Name, table, isBase, ct.ContentModel.UnhandledAttributes, isNillable);
1016 }
1017 }
1018 else
1019 {
1022 }
1023 }
1024 }
1025 else
1026 {
1027 isBase = true;
1028 if (!FromInference)
1029 {
1030 HandleAttributes(ct.Attributes, table, isBase);
1031 }
1032 if (ct.Particle != null)
1033 {
1034 HandleParticle(ct.Particle, table, tableChildren, isBase);
1035 }
1036 if (FromInference)
1037 {
1038 HandleAttributes(ct.Attributes, table, isBase);
1039 if (isNillable)
1040 {
1041 HandleSimpleContentColumn("string", table, isBase, null, isNillable);
1042 }
1043 }
1044 }
1046 }
1047
1049 {
1050 if (ct.ContentModel != null)
1051 {
1052 if (ct.ContentModel is XmlSchemaComplexContent)
1053 {
1054 XmlSchemaAnnotated content = ((XmlSchemaComplexContent)ct.ContentModel).Content;
1056 {
1057 return ((XmlSchemaComplexContentExtension)content).Particle;
1058 }
1059 return ((XmlSchemaComplexContentRestriction)content).Particle;
1060 }
1061 return null;
1062 }
1063 return ct.Particle;
1064 }
1065
1066 internal DataColumn FindField(DataTable table, string field)
1067 {
1068 bool flag = false;
1069 string text = field;
1070 if (field.StartsWith('@'))
1071 {
1072 flag = true;
1073 text = field.Substring(1);
1074 }
1075 text = text.Split(':')[^1];
1078 if (dataColumn == null)
1079 {
1081 }
1083 if (flag2 != flag)
1084 {
1086 }
1087 return dataColumn;
1088 }
1089
1091 {
1093 foreach (XmlSchemaXPath field in keyNode.Fields)
1094 {
1095 arrayList.Add(FindField(table, field.XPath));
1096 }
1099 return array;
1100 }
1101
1102 internal bool GetBooleanAttribute(XmlSchemaAnnotated element, string attrName, bool defVal)
1103 {
1104 string msdataAttribute = GetMsdataAttribute(element, attrName);
1105 if (msdataAttribute == null || msdataAttribute.Length == 0)
1106 {
1107 return defVal;
1108 }
1109 switch (msdataAttribute)
1110 {
1111 case "true":
1112 case "1":
1113 return true;
1114 case "false":
1115 case "0":
1116 return false;
1117 default:
1119 }
1120 }
1121
1122 internal string GetStringAttribute(XmlSchemaAnnotated element, string attrName, string defVal)
1123 {
1124 string msdataAttribute = GetMsdataAttribute(element, attrName);
1125 if (msdataAttribute == null || msdataAttribute.Length == 0)
1126 {
1127 return defVal;
1128 }
1129 return msdataAttribute;
1130 }
1131
1133 {
1134 if (strRule == "Cascade")
1135 {
1136 return AcceptRejectRule.Cascade;
1137 }
1138 _ = strRule == "None";
1139 return AcceptRejectRule.None;
1140 }
1141
1142 internal static Rule TranslateRule(string strRule)
1143 {
1144 return strRule switch
1145 {
1146 "Cascade" => Rule.Cascade,
1147 "None" => Rule.None,
1148 "SetDefault" => Rule.SetDefault,
1149 "SetNull" => Rule.SetNull,
1150 _ => Rule.Cascade,
1151 };
1152 }
1153
1154 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1156 {
1157 string text = XmlConvert.DecodeName(keyref.Refer.Name);
1158 string defVal = XmlConvert.DecodeName(keyref.Name);
1159 defVal = GetStringAttribute(keyref, "ConstraintName", defVal);
1160 string tableName = GetTableName(keyref);
1161 string msdataAttribute = GetMsdataAttribute(keyref, "TableNamespace");
1163 if (tableSmart == null)
1164 {
1165 return;
1166 }
1167 if (text == null || text.Length == 0)
1168 {
1170 }
1172 if (constraintTable == null)
1173 {
1175 }
1179 if (GetBooleanAttribute(keyref, "ConstraintOnly", defVal: false))
1180 {
1181 int num = array2[0].Table.Constraints.InternalIndexOf(defVal);
1182 if (num > -1 && array2[0].Table.Constraints[num].ConstraintName != defVal)
1183 {
1184 num = -1;
1185 }
1186 if (num < 0)
1187 {
1189 array2[0].Table.Constraints.Add(foreignKeyConstraint);
1190 }
1191 }
1192 else
1193 {
1194 string text2 = XmlConvert.DecodeName(GetStringAttribute(keyref, "RelationName", keyref.Name));
1195 if (text2 == null || text2.Length == 0)
1196 {
1197 text2 = defVal;
1198 }
1199 int num2 = array2[0].Table.DataSet.Relations.InternalIndexOf(text2);
1200 if (num2 > -1 && array2[0].Table.DataSet.Relations[num2].RelationName != text2)
1201 {
1202 num2 = -1;
1203 }
1205 if (num2 < 0)
1206 {
1208 SetExtProperties(dataRelation, keyref.UnhandledAttributes);
1209 array[0].Table.DataSet.Relations.Add(dataRelation);
1211 {
1212 _tableDictionary[dataRelation.ParentTable].Add(dataRelation.ChildTable);
1213 }
1214 foreignKeyConstraint = dataRelation.ChildKeyConstraint;
1216 }
1217 else
1218 {
1219 dataRelation = array2[0].Table.DataSet.Relations[num2];
1220 }
1221 if (GetBooleanAttribute(keyref, "IsNested", defVal: false))
1222 {
1223 dataRelation.Nested = true;
1224 }
1225 }
1226 string msdataAttribute2 = GetMsdataAttribute(keyref, "AcceptRejectRule");
1227 string msdataAttribute3 = GetMsdataAttribute(keyref, "UpdateRule");
1228 string msdataAttribute4 = GetMsdataAttribute(keyref, "DeleteRule");
1229 if (foreignKeyConstraint != null)
1230 {
1231 if (msdataAttribute2 != null)
1232 {
1234 }
1235 if (msdataAttribute3 != null)
1236 {
1238 }
1239 if (msdataAttribute4 != null)
1240 {
1242 }
1243 SetExtProperties(foreignKeyConstraint, keyref.UnhandledAttributes);
1244 }
1245 }
1246
1247 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1249 {
1250 string text = null;
1252 if (text == null || text.Length == 0)
1253 {
1254 throw ExceptionBuilder.MissingAttribute("name");
1255 }
1257 {
1259 }
1260 string tableName = GetTableName(keyNode);
1261 string msdataAttribute = GetMsdataAttribute(keyNode, "TableNamespace");
1263 if (tableSmart == null)
1264 {
1265 return;
1266 }
1268 bool booleanAttribute = GetBooleanAttribute(keyNode, "PrimaryKey", defVal: false);
1269 text = GetStringAttribute(keyNode, "ConstraintName", text);
1271 if (array.Length == 0)
1272 {
1273 return;
1274 }
1275 UniqueConstraint uniqueConstraint = (UniqueConstraint)array[0].Table.Constraints.FindConstraint(new UniqueConstraint(text, array));
1276 if (uniqueConstraint == null)
1277 {
1278 array[0].Table.Constraints.Add(text, array, booleanAttribute);
1279 SetExtProperties(array[0].Table.Constraints[text], keyNode.UnhandledAttributes);
1280 }
1281 else
1282 {
1283 array = uniqueConstraint.ColumnsReference;
1284 SetExtProperties(uniqueConstraint, keyNode.UnhandledAttributes);
1285 if (booleanAttribute)
1286 {
1287 array[0].Table.PrimaryKey = array;
1288 }
1289 }
1291 {
1292 for (int i = 0; i < array.Length; i++)
1293 {
1294 array[i].AllowDBNull = false;
1295 }
1296 }
1297 }
1298
1299 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1301 {
1303 string @namespace = node.QualifiedName.Namespace;
1304 DataTable dataTable = _ds.Tables.GetTable(text, @namespace);
1305 if (!FromInference && dataTable != null)
1306 {
1308 }
1309 if (dataTable == null)
1310 {
1311 dataTable = new DataTable(text);
1312 dataTable.Namespace = @namespace;
1313 dataTable.Namespace = GetStringAttribute(node, "targetNamespace", @namespace);
1314 if (!FromInference)
1315 {
1316 dataTable.MinOccurs = node.MinOccurs;
1317 dataTable.MaxOccurs = node.MaxOccurs;
1318 }
1319 else
1320 {
1321 string prefix = GetPrefix(@namespace);
1322 if (prefix != null)
1323 {
1325 }
1326 }
1327 SetProperties(dataTable, node.UnhandledAttributes);
1328 SetExtProperties(dataTable, node.UnhandledAttributes);
1329 }
1332 if (!FromInference || (flag && dataTable.Columns.Count == 0))
1333 {
1334 HandleElementColumn(node, dataTable, isBase: false);
1335 string text2;
1336 if (FromInference)
1337 {
1338 int num = 0;
1339 text2 = text + "_Text";
1340 while (dataTable.Columns[text2] != null)
1341 {
1342 text2 += num++;
1343 }
1344 }
1345 else
1346 {
1347 text2 = text + "_Column";
1348 }
1349 dataTable.Columns[0].ColumnName = text2;
1350 dataTable.Columns[0].ColumnMapping = MappingType.SimpleContent;
1351 }
1352 if (!FromInference || _ds.Tables.GetTable(text, @namespace) == null)
1353 {
1354 _ds.Tables.Add(dataTable);
1355 if (FromInference)
1356 {
1357 _tableDictionary.Add(dataTable, new List<DataTable>());
1358 }
1359 }
1360 if (_dsElement != null && _dsElement.Constraints != null)
1361 {
1362 foreach (XmlSchemaIdentityConstraint constraint in _dsElement.Constraints)
1363 {
1364 if (!(constraint is XmlSchemaKeyref) && GetTableName(constraint) == dataTable.TableName)
1365 {
1366 HandleConstraint(constraint);
1367 }
1368 }
1369 }
1371 return dataTable;
1372 }
1373
1375 {
1376 string result = null;
1378 {
1380 result = ((xmlSchemaElement.Name != null) ? xmlSchemaElement.Name : xmlSchemaElement.RefName.Name);
1381 }
1382 else if (node is XmlSchemaAttribute)
1383 {
1385 result = ((xmlSchemaAttribute.Name != null) ? xmlSchemaAttribute.Name : xmlSchemaAttribute.RefName.Name);
1386 }
1387 return result;
1388 }
1389
1390 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1392 {
1395 string @namespace = node.QualifiedName.Namespace;
1397 if (!FromInference || (FromInference && dataTable == null))
1398 {
1399 if (dataTable != null)
1400 {
1401 if (isRef)
1402 {
1403 return dataTable;
1404 }
1406 }
1407 if (isRef)
1408 {
1409 _refTables.Add(@namespace + ":" + instanceName);
1410 }
1412 dataTable.TypeName = node.SchemaTypeName;
1413 dataTable.Namespace = @namespace;
1414 dataTable.Namespace = GetStringAttribute(node, "targetNamespace", @namespace);
1415 string stringAttribute = GetStringAttribute(typeNode, "CaseSensitive", "");
1416 if (stringAttribute.Length == 0)
1417 {
1418 stringAttribute = GetStringAttribute(node, "CaseSensitive", "");
1419 }
1420 if (0 < stringAttribute.Length)
1421 {
1422 if (stringAttribute == "true" || stringAttribute == "True")
1423 {
1425 }
1426 if (stringAttribute == "false" || stringAttribute == "False")
1427 {
1429 }
1430 }
1431 stringAttribute = GetMsdataAttribute(node, "Locale");
1432 if (stringAttribute != null)
1433 {
1434 if (0 < stringAttribute.Length)
1435 {
1437 }
1438 else
1439 {
1441 }
1442 }
1443 if (!FromInference)
1444 {
1445 dataTable.MinOccurs = node.MinOccurs;
1446 dataTable.MaxOccurs = node.MaxOccurs;
1447 }
1448 else
1449 {
1450 string prefix = GetPrefix(@namespace);
1451 if (prefix != null)
1452 {
1454 }
1455 }
1456 _ds.Tables.Add(dataTable);
1457 if (FromInference)
1458 {
1459 _tableDictionary.Add(dataTable, new List<DataTable>());
1460 }
1461 }
1462 HandleComplexType(typeNode, dataTable, arrayList, node.IsNillable);
1463 for (int i = 0; i < dataTable.Columns.Count; i++)
1464 {
1465 dataTable.Columns[i].SetOrdinalInternal(i);
1466 }
1467 SetProperties(dataTable, node.UnhandledAttributes);
1468 SetExtProperties(dataTable, node.UnhandledAttributes);
1469 if (_dsElement != null && _dsElement.Constraints != null)
1470 {
1471 foreach (XmlSchemaIdentityConstraint constraint in _dsElement.Constraints)
1472 {
1473 if (!(constraint is XmlSchemaKeyref) && GetTableName(constraint) == dataTable.TableName && (GetTableNamespace(constraint) == dataTable.Namespace || GetTableNamespace(constraint) == null))
1474 {
1475 HandleConstraint(constraint);
1476 }
1477 }
1478 }
1479 foreach (DataTable item in arrayList)
1480 {
1481 if (item != dataTable && dataTable.Namespace == item.Namespace)
1482 {
1483 item._tableNamespace = null;
1484 }
1485 if (_dsElement != null && _dsElement.Constraints != null)
1486 {
1488 {
1489 if (!(constraint2 is XmlSchemaKeyref xmlSchemaKeyref) || !GetBooleanAttribute(xmlSchemaKeyref, "IsNested", defVal: false) || !(GetTableName(xmlSchemaKeyref) == item.TableName))
1490 {
1491 continue;
1492 }
1493 if (item.DataSet.Tables.InternalIndexOf(item.TableName) < -1)
1494 {
1495 if (GetTableNamespace(xmlSchemaKeyref) == item.Namespace)
1496 {
1497 HandleKeyref(xmlSchemaKeyref);
1498 }
1499 }
1500 else
1501 {
1502 HandleKeyref(xmlSchemaKeyref);
1503 }
1504 }
1505 }
1508 for (int j = 0; j < childRelations.Count; j++)
1509 {
1510 if (childRelations[j].Nested && item == childRelations[j].ChildTable)
1511 {
1513 }
1514 }
1515 if (dataRelation != null)
1516 {
1517 continue;
1518 }
1520 if (FromInference)
1521 {
1522 int num = dataTable.UKColumnPositionForInference;
1523 if (num == -1)
1524 {
1525 foreach (DataColumn column in dataTable.Columns)
1526 {
1527 if (column.ColumnMapping == MappingType.Attribute)
1528 {
1529 num = column.Ordinal;
1530 break;
1531 }
1532 }
1533 }
1534 dataColumn2 = dataTable.AddUniqueKey(num);
1535 }
1536 else
1537 {
1538 dataColumn2 = dataTable.AddUniqueKey();
1539 }
1540 DataColumn dataColumn3 = item.AddForeignKey(dataColumn2);
1541 if (FromInference)
1542 {
1543 dataColumn3.Prefix = item.Prefix;
1544 }
1545 dataRelation = new DataRelation(dataTable.TableName + "_" + item.TableName, dataColumn2, dataColumn3, createConstraints: true);
1546 dataRelation.Nested = true;
1547 item.DataSet.Relations.Add(dataRelation);
1548 if (FromInference && dataRelation.Nested && _tableDictionary.ContainsKey(dataRelation.ParentTable))
1549 {
1550 _tableDictionary[dataRelation.ParentTable].Add(dataRelation.ChildTable);
1551 }
1552 }
1553 return dataTable;
1554 }
1555
1556 public static Type XsdtoClr(string xsdTypeName)
1557 {
1559 if (num < 0)
1560 {
1562 }
1563 return s_mapNameTypeXsd[num].type;
1564 }
1565
1566 private static NameType FindNameType(string name)
1567 {
1568 int num = Array.BinarySearch(s_mapNameTypeXsd, name);
1569 if (num < 0)
1570 {
1572 }
1573 return s_mapNameTypeXsd[num];
1574 }
1575
1577 private Type ParseDataType(string dt)
1578 {
1579 if (!IsXsdType(dt) && _udSimpleTypes != null)
1580 {
1582 if (xmlSchemaSimpleType == null)
1583 {
1585 }
1587 while (simpleType.BaseSimpleType != null)
1588 {
1589 simpleType = simpleType.BaseSimpleType;
1590 }
1591 return ParseDataType(simpleType.BaseType);
1592 }
1594 return nameType.type;
1595 }
1596
1597 internal static bool IsXsdType(string name)
1598 {
1599 int num = Array.BinarySearch(s_mapNameTypeXsd, name);
1600 if (num < 0)
1601 {
1602 return false;
1603 }
1604 return true;
1605 }
1606
1608 {
1611 bool flag = false;
1612 if (xmlSchemaAttribute != null)
1613 {
1614 flag = true;
1615 }
1616 string text = (flag ? xmlSchemaAttribute.SchemaTypeName.Name : xmlSchemaElement.SchemaTypeName.Name);
1617 string text2 = (flag ? xmlSchemaAttribute.SchemaTypeName.Namespace : xmlSchemaElement.SchemaTypeName.Namespace);
1618 if (text2 == "http://www.w3.org/2001/XMLSchema")
1619 {
1620 return null;
1621 }
1622 if (text == null || text.Length == 0)
1623 {
1624 text = (flag ? xmlSchemaAttribute.RefName.Name : xmlSchemaElement.RefName.Name);
1625 if (text == null || text.Length == 0)
1626 {
1627 return flag ? xmlSchemaAttribute.SchemaType : xmlSchemaElement.SchemaType;
1628 }
1630 }
1631 return (XmlSchemaAnnotated)_schemaTypes[flag ? ((XmlSchemaAttribute)node).SchemaTypeName : ((XmlSchemaElement)node).SchemaTypeName];
1632 }
1633
1634 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1636 {
1637 if (FromInference && table.XmlText != null)
1638 {
1639 return;
1640 }
1641 Type type = null;
1642 SimpleType simpleType = null;
1643 if (typeNode.QualifiedName.Name != null && typeNode.QualifiedName.Name.Length != 0 && typeNode.QualifiedName.Namespace != "http://www.w3.org/2001/XMLSchema")
1644 {
1646 strType = typeNode.QualifiedName.ToString();
1647 type = ParseDataType(typeNode.QualifiedName.ToString());
1648 }
1649 else if (typeNode.BaseXmlSchemaType is XmlSchemaSimpleType xmlSchemaSimpleType && xmlSchemaSimpleType.QualifiedName.Namespace != "http://www.w3.org/2001/XMLSchema")
1650 {
1653 while (simpleType2.BaseSimpleType != null)
1654 {
1655 simpleType2 = simpleType2.BaseSimpleType;
1656 }
1657 type = ParseDataType(simpleType2.BaseType);
1658 strType = simpleType.Name;
1659 }
1660 else
1661 {
1663 }
1664 string text;
1665 if (FromInference)
1666 {
1667 int num = 0;
1668 text = table.TableName + "_Text";
1669 while (table.Columns[text] != null)
1670 {
1671 text += num++;
1672 }
1673 }
1674 else
1675 {
1676 text = table.TableName + "_text";
1677 }
1678 string text2 = text;
1679 bool flag = true;
1681 if (!isBase && table.Columns.Contains(text2, caseSensitive: true))
1682 {
1683 dataColumn = table.Columns[text2];
1684 flag = false;
1685 }
1686 else
1687 {
1688 dataColumn = new DataColumn(text2, type, null, MappingType.SimpleContent);
1689 }
1694 string text3 = null;
1696 if (attrs != null)
1697 {
1698 for (int i = 0; i < attrs.Length; i++)
1699 {
1700 if (attrs[i].LocalName == "AllowDBNull" && attrs[i].NamespaceURI == "urn:schemas-microsoft-com:xml-msdata" && attrs[i].Value == "false")
1701 {
1702 dataColumn.AllowDBNull = false;
1703 }
1704 if (attrs[i].LocalName == "Ordinal" && attrs[i].NamespaceURI == "urn:schemas-microsoft-com:xml-msdata")
1705 {
1706 value = attrs[i].Value;
1707 }
1708 if (attrs[i].LocalName == "DefaultValue" && attrs[i].NamespaceURI == "urn:schemas-microsoft-com:xml-msdata")
1709 {
1710 text3 = attrs[i].Value;
1711 }
1712 }
1713 }
1714 int num2 = (int)Convert.ChangeType(value, typeof(int), null);
1715 if (dataColumn.Expression != null && dataColumn.Expression.Length != 0)
1716 {
1718 }
1719 if (simpleType != null && simpleType.Name != null && simpleType.Name.Length > 0)
1720 {
1721 if (GetMsdataAttribute(typeNode, "targetNamespace") != null)
1722 {
1723 dataColumn.XmlDataType = simpleType.SimpleTypeQualifiedName;
1724 }
1725 }
1726 else
1727 {
1729 }
1731 if (flag)
1732 {
1733 if (FromInference)
1734 {
1737 }
1738 if (num2 > -1 && num2 < table.Columns.Count)
1739 {
1740 table.Columns.AddAt(num2, dataColumn);
1741 }
1742 else
1743 {
1744 table.Columns.Add(dataColumn);
1745 }
1746 }
1747 if (text3 != null)
1748 {
1749 try
1750 {
1751 dataColumn.DefaultValue = dataColumn.ConvertXmlToObject(text3);
1752 }
1753 catch (FormatException)
1754 {
1755 throw ExceptionBuilder.CannotConvert(text3, type.FullName);
1756 }
1757 }
1758 }
1759
1760 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1762 {
1763 if (FromInference && table.XmlText != null)
1764 {
1765 return;
1766 }
1767 Type type = null;
1768 if (strType == null)
1769 {
1770 return;
1771 }
1773 string text;
1774 if (FromInference)
1775 {
1776 int num = 0;
1777 text = table.TableName + "_Text";
1778 while (table.Columns[text] != null)
1779 {
1780 text += num++;
1781 }
1782 }
1783 else
1784 {
1785 text = table.TableName + "_text";
1786 }
1787 string text2 = text;
1788 bool flag = true;
1790 if (!isBase && table.Columns.Contains(text2, caseSensitive: true))
1791 {
1792 dataColumn = table.Columns[text2];
1793 flag = false;
1794 }
1795 else
1796 {
1797 dataColumn = new DataColumn(text2, type, null, MappingType.SimpleContent);
1798 }
1803 string text3 = null;
1805 if (attrs != null)
1806 {
1807 for (int i = 0; i < attrs.Length; i++)
1808 {
1809 if (attrs[i].LocalName == "AllowDBNull" && attrs[i].NamespaceURI == "urn:schemas-microsoft-com:xml-msdata" && attrs[i].Value == "false")
1810 {
1811 dataColumn.AllowDBNull = false;
1812 }
1813 if (attrs[i].LocalName == "Ordinal" && attrs[i].NamespaceURI == "urn:schemas-microsoft-com:xml-msdata")
1814 {
1815 value = attrs[i].Value;
1816 }
1817 if (attrs[i].LocalName == "DefaultValue" && attrs[i].NamespaceURI == "urn:schemas-microsoft-com:xml-msdata")
1818 {
1819 text3 = attrs[i].Value;
1820 }
1821 }
1822 }
1823 int num2 = (int)Convert.ChangeType(value, typeof(int), null);
1824 if (dataColumn.Expression != null && dataColumn.Expression.Length != 0)
1825 {
1827 }
1829 dataColumn.SimpleType = null;
1830 if (FromInference)
1831 {
1833 }
1834 if (flag)
1835 {
1836 if (FromInference)
1837 {
1839 }
1840 if (num2 > -1 && num2 < table.Columns.Count)
1841 {
1842 table.Columns.AddAt(num2, dataColumn);
1843 }
1844 else
1845 {
1846 table.Columns.Add(dataColumn);
1847 }
1848 }
1849 if (text3 == null)
1850 {
1851 return;
1852 }
1853 try
1854 {
1855 dataColumn.DefaultValue = dataColumn.ConvertXmlToObject(text3);
1856 }
1857 catch (FormatException)
1858 {
1859 throw ExceptionBuilder.CannotConvert(text3, type.FullName);
1860 }
1861 }
1862
1863 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1865 {
1866 Type type = null;
1869 string text = null;
1870 SimpleType simpleType = null;
1871 if (xmlSchemaAnnotated == null)
1872 {
1873 text = xmlSchemaAttribute.SchemaTypeName.Name;
1874 if (!string.IsNullOrEmpty(text))
1875 {
1876 type = ((!(xmlSchemaAttribute.SchemaTypeName.Namespace != "http://www.w3.org/2001/XMLSchema")) ? ParseDataType(xmlSchemaAttribute.SchemaTypeName.Name) : ParseDataType(xmlSchemaAttribute.SchemaTypeName.ToString()));
1877 }
1878 else
1879 {
1880 text = string.Empty;
1881 type = typeof(string);
1882 }
1883 }
1885 {
1888 if (xmlSchemaSimpleType.QualifiedName.Name != null && xmlSchemaSimpleType.QualifiedName.Name.Length != 0 && xmlSchemaSimpleType.QualifiedName.Namespace != "http://www.w3.org/2001/XMLSchema")
1889 {
1890 text = xmlSchemaSimpleType.QualifiedName.ToString();
1891 type = ParseDataType(xmlSchemaSimpleType.QualifiedName.ToString());
1892 }
1893 else
1894 {
1895 type = ParseDataType(simpleType.BaseType);
1896 text = simpleType.Name;
1897 if (simpleType.Length == 1 && type == typeof(string))
1898 {
1899 type = typeof(char);
1900 }
1901 }
1902 }
1903 else
1904 {
1906 {
1907 if (xmlSchemaAnnotated.Id == null)
1908 {
1910 }
1912 }
1913 text = ((XmlSchemaElement)xmlSchemaAnnotated).SchemaTypeName.Name;
1915 }
1917 bool flag = true;
1919 if ((!isBase || FromInference) && table.Columns.Contains(text2, caseSensitive: true))
1920 {
1921 dataColumn = table.Columns[text2];
1922 flag = false;
1923 if (FromInference)
1924 {
1925 if (dataColumn.ColumnMapping != MappingType.Attribute)
1926 {
1928 }
1929 if ((string.IsNullOrEmpty(attrib.QualifiedName.Namespace) && string.IsNullOrEmpty(dataColumn._columnUri)) || string.Equals(attrib.QualifiedName.Namespace, dataColumn.Namespace, StringComparison.Ordinal))
1930 {
1931 return;
1932 }
1933 dataColumn = new DataColumn(text2, type, null, MappingType.Attribute);
1934 flag = true;
1935 }
1936 }
1937 else
1938 {
1939 dataColumn = new DataColumn(text2, type, null, MappingType.Attribute);
1940 }
1941 SetProperties(dataColumn, xmlSchemaAttribute.UnhandledAttributes);
1943 SetExtProperties(dataColumn, xmlSchemaAttribute.UnhandledAttributes);
1944 if (dataColumn.Expression != null && dataColumn.Expression.Length != 0)
1945 {
1947 }
1948 if (simpleType != null && simpleType.Name != null && simpleType.Name.Length > 0)
1949 {
1950 if (GetMsdataAttribute(xmlSchemaAnnotated, "targetNamespace") != null)
1951 {
1952 dataColumn.XmlDataType = simpleType.SimpleTypeQualifiedName;
1953 }
1954 }
1955 else
1956 {
1958 }
1961 dataColumn.Namespace = attrib.QualifiedName.Namespace;
1962 dataColumn.Namespace = GetStringAttribute(attrib, "targetNamespace", dataColumn.Namespace);
1963 if (flag)
1964 {
1965 if (FromInference)
1966 {
1969 }
1970 table.Columns.Add(dataColumn);
1971 }
1972 if (attrib.Use == XmlSchemaUse.Prohibited)
1973 {
1976 string msdataAttribute = GetMsdataAttribute(xmlSchemaAttribute, "DefaultValue");
1977 if (msdataAttribute != null)
1978 {
1979 try
1980 {
1982 }
1983 catch (FormatException)
1984 {
1986 }
1987 }
1988 }
1989 string text3 = ((attrib.Use == XmlSchemaUse.Required) ? GetMsdataAttribute(xmlSchemaAttribute, "DefaultValue") : xmlSchemaAttribute.DefaultValue);
1990 if (xmlSchemaAttribute.Use == XmlSchemaUse.Optional && text3 == null)
1991 {
1992 text3 = xmlSchemaAttribute.FixedValue;
1993 }
1994 if (text3 != null)
1995 {
1996 try
1997 {
1998 dataColumn.DefaultValue = dataColumn.ConvertXmlToObject(text3);
1999 }
2000 catch (FormatException)
2001 {
2002 throw ExceptionBuilder.CannotConvert(text3, type.FullName);
2003 }
2004 }
2005 }
2006
2007 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2009 {
2010 Type type = null;
2012 if (xmlSchemaElement == null)
2013 {
2014 return;
2015 }
2017 string text = null;
2018 SimpleType simpleType = null;
2019 if (xmlSchemaAnnotated == null)
2020 {
2021 text = xmlSchemaElement.SchemaTypeName.Name;
2022 if (string.IsNullOrEmpty(text))
2023 {
2024 text = string.Empty;
2025 type = typeof(string);
2026 }
2027 else
2028 {
2029 type = ParseDataType(xmlSchemaElement.SchemaTypeName.Name);
2030 }
2031 }
2033 {
2035 simpleType = new SimpleType(node);
2036 if (((XmlSchemaSimpleType)xmlSchemaAnnotated).Name != null && ((XmlSchemaSimpleType)xmlSchemaAnnotated).Name.Length != 0 && ((XmlSchemaSimpleType)xmlSchemaAnnotated).QualifiedName.Namespace != "http://www.w3.org/2001/XMLSchema")
2037 {
2038 text = ((XmlSchemaSimpleType)xmlSchemaAnnotated).QualifiedName.ToString();
2040 }
2041 else
2042 {
2043 for (node = ((simpleType.XmlBaseType != null && simpleType.XmlBaseType.Namespace != "http://www.w3.org/2001/XMLSchema") ? (_schemaTypes[simpleType.XmlBaseType] as XmlSchemaSimpleType) : null); node != null; node = ((simpleType.XmlBaseType != null && simpleType.XmlBaseType.Namespace != "http://www.w3.org/2001/XMLSchema") ? (_schemaTypes[simpleType.XmlBaseType] as XmlSchemaSimpleType) : null))
2044 {
2045 simpleType.LoadTypeValues(node);
2046 }
2047 type = ParseDataType(simpleType.BaseType);
2048 text = simpleType.Name;
2049 if (simpleType.Length == 1 && type == typeof(string))
2050 {
2051 type = typeof(char);
2052 }
2053 }
2054 }
2056 {
2057 text = ((XmlSchemaElement)xmlSchemaAnnotated).SchemaTypeName.Name;
2059 }
2060 else
2061 {
2063 {
2064 if (xmlSchemaAnnotated.Id == null)
2065 {
2067 }
2069 }
2070 if (string.IsNullOrEmpty(GetMsdataAttribute(elem, "DataType")))
2071 {
2073 }
2074 type = typeof(object);
2075 }
2077 bool flag = true;
2079 if ((!isBase || FromInference) && table.Columns.Contains(text2, caseSensitive: true))
2080 {
2081 dataColumn = table.Columns[text2];
2082 flag = false;
2083 if (FromInference)
2084 {
2085 if (dataColumn.ColumnMapping != MappingType.Element)
2086 {
2088 }
2089 if ((string.IsNullOrEmpty(elem.QualifiedName.Namespace) && string.IsNullOrEmpty(dataColumn._columnUri)) || string.Equals(elem.QualifiedName.Namespace, dataColumn.Namespace, StringComparison.Ordinal))
2090 {
2091 return;
2092 }
2093 dataColumn = new DataColumn(text2, type, null, MappingType.Element);
2094 flag = true;
2095 }
2096 }
2097 else
2098 {
2099 dataColumn = new DataColumn(text2, type, null, MappingType.Element);
2100 }
2101 SetProperties(dataColumn, xmlSchemaElement.UnhandledAttributes);
2103 SetExtProperties(dataColumn, xmlSchemaElement.UnhandledAttributes);
2104 if (!string.IsNullOrEmpty(dataColumn.Expression))
2105 {
2107 }
2108 if (simpleType != null && simpleType.Name != null && simpleType.Name.Length > 0)
2109 {
2110 if (GetMsdataAttribute(xmlSchemaAnnotated, "targetNamespace") != null)
2111 {
2112 dataColumn.XmlDataType = simpleType.SimpleTypeQualifiedName;
2113 }
2114 }
2115 else
2116 {
2118 }
2121 if (!elem.RefName.IsEmpty || elem.QualifiedName.Namespace != table.Namespace)
2122 {
2123 dataColumn.Namespace = elem.QualifiedName.Namespace;
2124 dataColumn.Namespace = GetStringAttribute(xmlSchemaElement, "targetNamespace", dataColumn.Namespace);
2125 }
2126 else if (elem.Form == XmlSchemaForm.Unqualified)
2127 {
2128 dataColumn.Namespace = string.Empty;
2129 }
2130 else if (elem.Form == XmlSchemaForm.None)
2131 {
2132 XmlSchemaObject parent = elem.Parent;
2133 while (parent.Parent != null)
2134 {
2135 parent = parent.Parent;
2136 }
2137 if (((XmlSchema)parent).ElementFormDefault == XmlSchemaForm.Unqualified)
2138 {
2139 dataColumn.Namespace = string.Empty;
2140 }
2141 }
2142 else
2143 {
2144 dataColumn.Namespace = elem.QualifiedName.Namespace;
2145 dataColumn.Namespace = GetStringAttribute(xmlSchemaElement, "targetNamespace", dataColumn.Namespace);
2146 }
2148 int num = (int)Convert.ChangeType(stringAttribute, typeof(int), null);
2149 if (flag)
2150 {
2151 if (num > -1 && num < table.Columns.Count)
2152 {
2153 table.Columns.AddAt(num, dataColumn);
2154 }
2155 else
2156 {
2157 table.Columns.Add(dataColumn);
2158 }
2159 }
2160 if (dataColumn.Namespace == table.Namespace)
2161 {
2162 dataColumn._columnUri = null;
2163 }
2164 if (FromInference)
2165 {
2167 }
2168 string defaultValue = xmlSchemaElement.DefaultValue;
2169 if (defaultValue == null)
2170 {
2171 return;
2172 }
2173 try
2174 {
2175 dataColumn.DefaultValue = dataColumn.ConvertXmlToObject(defaultValue);
2176 }
2177 catch (FormatException)
2178 {
2180 }
2181 }
2182
2183 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2185 {
2186 string text = node.Name;
2187 string @namespace = node.QualifiedName.Namespace;
2189 string msdataAttribute = GetMsdataAttribute(node, "Locale");
2190 if (msdataAttribute != null)
2191 {
2192 if (msdataAttribute.Length != 0)
2193 {
2195 }
2196 else
2197 {
2199 }
2200 }
2201 else if (GetBooleanAttribute(node, "UseCurrentLocale", defVal: false))
2202 {
2204 }
2205 else
2206 {
2207 _ds.SetLocaleValue(new CultureInfo(1033), userSet: false);
2208 }
2209 msdataAttribute = GetMsdataAttribute(node, "DataSetName");
2210 if (msdataAttribute != null && msdataAttribute.Length != 0)
2211 {
2213 }
2214 msdataAttribute = GetMsdataAttribute(node, "DataSetNamespace");
2215 if (msdataAttribute != null && msdataAttribute.Length != 0)
2216 {
2217 @namespace = msdataAttribute;
2218 }
2219 SetProperties(_ds, node.UnhandledAttributes);
2220 SetExtProperties(_ds, node.UnhandledAttributes);
2221 if (text != null && text.Length != 0)
2222 {
2224 }
2225 _ds.Namespace = @namespace;
2226 if (FromInference)
2227 {
2228 _ds.Prefix = GetPrefix(_ds.Namespace);
2229 }
2231 if (xmlSchemaComplexType.Particle != null)
2232 {
2234 if (particleItems == null)
2235 {
2236 return;
2237 }
2239 {
2241 {
2242 if (((XmlSchemaElement)item).RefName.Name.Length != 0)
2243 {
2244 if (!FromInference)
2245 {
2246 continue;
2247 }
2248 DataTable table = _ds.Tables.GetTable(XmlConvert.DecodeName(GetInstanceName((XmlSchemaElement)item)), node.QualifiedName.Namespace);
2249 if (table != null)
2250 {
2251 list.Add(table);
2252 }
2253 bool flag = false;
2254 if (node.ElementSchemaType != null || !(((XmlSchemaElement)item).SchemaType is XmlSchemaComplexType))
2255 {
2256 flag = true;
2257 }
2258 if (((XmlSchemaElement)item).MaxOccurs != 1m && !flag)
2259 {
2260 continue;
2261 }
2262 }
2263 DataTable dataTable = HandleTable((XmlSchemaElement)item);
2264 if (dataTable != null)
2265 {
2267 }
2268 if (FromInference)
2269 {
2270 list.Add(dataTable);
2271 }
2272 }
2273 else
2274 {
2275 if (!(item is XmlSchemaChoice))
2276 {
2277 continue;
2278 }
2280 if (items == null)
2281 {
2282 continue;
2283 }
2284 foreach (XmlSchemaAnnotated item2 in items)
2285 {
2286 if (!(item2 is XmlSchemaElement))
2287 {
2288 continue;
2289 }
2291 {
2292 ((XmlSchemaElement)item2).MaxOccurs = ((XmlSchemaParticle)item).MaxOccurs;
2293 }
2294 if (((XmlSchemaElement)item2).RefName.Name.Length == 0 || FromInference || !(((XmlSchemaElement)item2).MaxOccurs != 1m) || ((XmlSchemaElement)item2).SchemaType is XmlSchemaComplexType)
2295 {
2297 if (FromInference)
2298 {
2299 list.Add(dataTable2);
2300 }
2301 if (dataTable2 != null)
2302 {
2304 }
2305 }
2306 }
2307 }
2308 }
2309 }
2310 if (node.Constraints != null)
2311 {
2312 foreach (XmlSchemaIdentityConstraint constraint in node.Constraints)
2313 {
2314 if (constraint is XmlSchemaKeyref xmlSchemaKeyref && !GetBooleanAttribute(xmlSchemaKeyref, "IsNested", defVal: false))
2315 {
2316 HandleKeyref(xmlSchemaKeyref);
2317 }
2318 }
2319 }
2320 if (!(FromInference && isNewDataSet))
2321 {
2322 return;
2323 }
2325 foreach (DataTable item3 in list)
2326 {
2327 AddTablesToList(tableList, item3);
2328 }
2330 }
2331
2333 {
2334 if (tableList.Contains(dt))
2335 {
2336 return;
2337 }
2338 tableList.Add(dt);
2339 foreach (DataTable item in _tableDictionary[dt])
2340 {
2341 AddTablesToList(tableList, item);
2342 }
2343 }
2344
2345 private string GetPrefix(string ns)
2346 {
2347 if (ns == null)
2348 {
2349 return null;
2350 }
2351 foreach (XmlSchema item in _schemaSet.Schemas())
2352 {
2353 XmlQualifiedName[] array = item.Namespaces.ToArray();
2354 for (int i = 0; i < array.Length; i++)
2355 {
2356 if (array[i].Namespace == ns)
2357 {
2358 return array[i].Name;
2359 }
2360 }
2361 }
2362 return null;
2363 }
2364
2365 private string GetNamespaceFromPrefix(string prefix)
2366 {
2367 if (prefix == null || prefix.Length == 0)
2368 {
2369 return null;
2370 }
2371 foreach (XmlSchema item in _schemaSet.Schemas())
2372 {
2373 XmlQualifiedName[] array = item.Namespaces.ToArray();
2374 for (int i = 0; i < array.Length; i++)
2375 {
2376 if (array[i].Name == prefix)
2377 {
2378 return array[i].Namespace;
2379 }
2380 }
2381 }
2382 return null;
2383 }
2384
2386 {
2387 string xPath = key.Selector.XPath;
2388 string[] array = xPath.Split('/');
2389 string empty = string.Empty;
2390 string text = array[^1];
2391 if (text == null || text.Length == 0)
2392 {
2394 }
2395 if (text.Contains(':'))
2396 {
2397 empty = text.Substring(0, text.IndexOf(':'));
2399 return GetNamespaceFromPrefix(empty);
2400 }
2401 return GetMsdataAttribute(key, "TableNamespace");
2402 }
2403
2405 {
2406 string xPath = key.Selector.XPath;
2407 string text = xPath.Split('/', ':')[^1];
2408 if (text == null || text.Length == 0)
2409 {
2411 }
2412 return XmlConvert.DecodeName(text);
2413 }
2414
2416 {
2417 if (node.MaxOccurs == 0m)
2418 {
2419 return false;
2420 }
2421 XmlAttribute[] unhandledAttributes = node.UnhandledAttributes;
2422 if (unhandledAttributes != null)
2423 {
2425 {
2426 if (xmlAttribute.LocalName == "DataType" && xmlAttribute.Prefix == "msdata" && xmlAttribute.NamespaceURI == "urn:schemas-microsoft-com:xml-msdata")
2427 {
2428 return false;
2429 }
2430 }
2431 }
2432 object obj = FindTypeNode(node);
2433 if (node.MaxOccurs > 1m && obj == null)
2434 {
2435 return true;
2436 }
2437 if (obj == null || !(obj is XmlSchemaComplexType))
2438 {
2439 return false;
2440 }
2442 if (xmlSchemaComplexType.IsAbstract)
2443 {
2445 }
2446 return true;
2447 }
2448
2449 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2451 {
2452 if (!IsTable(node))
2453 {
2454 return null;
2455 }
2456 object obj = FindTypeNode(node);
2457 if (node.MaxOccurs > 1m && obj == null)
2458 {
2459 return InstantiateSimpleTable(node);
2460 }
2461 DataTable dataTable = InstantiateTable(node, (XmlSchemaComplexType)obj, node.RefName != null);
2463 return dataTable;
2464 }
2465}
static int BinarySearch(Array array, object? value)
Definition Array.cs:1320
virtual void Remove(object? obj)
virtual int Add(object? value)
virtual bool Contains(object? item)
void CopyTo(KeyValuePair< TKey, TValue >[] array, int index)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
virtual bool ContainsKey(object key)
Definition Hashtable.cs:724
virtual void Add(object key, object? value)
Definition Hashtable.cs:676
static PropertyDescriptorCollection GetProperties([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
static ? object ChangeType(object? value, TypeCode typeCode)
Definition Convert.cs:229
static Type GetType(string value)
void AddAt(int index, DataColumn column)
DataRelationCollection Relations
Definition DataSet.cs:393
DataTableCollection Tables
Definition DataSet.cs:396
void SetLocaleValue(CultureInfo value, bool userSet)
Definition DataSet.cs:825
DataTable GetTableSmart(string name, string ns)
void ReplaceFromInference(List< DataTable > tableList)
DataTable GetTable(string name, string ns)
DataColumn? XmlText
Definition DataTable.cs:855
DataColumnCollection Columns
Definition DataTable.cs:327
DataRelationCollection ChildRelations
Definition DataTable.cs:324
static Exception DuplicateConstraintRead(string str)
static Exception MissingAttribute(string attribute)
static Exception RelationParentNameMissing(string rel)
static Exception TooManyIsDataSetAttributesInSchema()
static Exception CannotInstantiateAbstract(string name)
static Exception ColumnTypeConflict(string name)
static Exception UndefinedDatatype(string name)
static Exception InvalidAttributeValue(string name, string value)
static Exception ElementTypeNotFound(string name)
static Exception IsDataSetAttributeMissingInSchema()
static Exception RelationChildKeyMissing(string rel)
static Exception DuplicateDeclaration(string name)
static Exception DatatypeNotDefined()
static Exception RelationChildNameMissing(string rel)
static Exception InvalidSelector(string name)
static Exception CannotConvert(string name, string type)
static Exception InvalidField(string name)
static Exception InvalidKey(string name)
static Exception InvalidDuplicateNamedSimpleTypeDelaration(string stName, string errorStr)
static Exception MissingRefer(string name)
static Exception MismatchKeyLength()
static Exception RelationTableKeyMissing(string rel)
static Exception CircularComplexType(string name)
static bool FEqualIdentity(XmlNode node, string name, string ns)
Definition XMLSchema.cs:68
static TypeConverter GetConverter(Type type)
Definition XMLSchema.cs:12
NameType(string n, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields|DynamicallyAccessedMemberTypes.PublicProperties)] Type t)
Definition XSDSchema.cs:21
string GetInstanceName(XmlSchemaAnnotated node)
Hashtable _constraintNodes
Definition XSDSchema.cs:43
int DatasetElementCount(XmlSchemaObjectCollection elements)
Definition XSDSchema.cs:514
ArrayList _complexTypes
Definition XSDSchema.cs:47
void HandleRelation(XmlElement node, bool fNested)
Definition XSDSchema.cs:387
bool HasAttributes(XmlSchemaObjectCollection attributes)
Definition XSDSchema.cs:465
void CollectElementsAnnotations(XmlSchema schema)
Definition XSDSchema.cs:131
string GetStringAttribute(XmlSchemaAnnotated element, string attrName, string defVal)
void CollectElementsAnnotations(XmlSchema schema, ArrayList schemaList)
Definition XSDSchema.cs:138
void HandleSimpleTypeSimpleContentColumn(XmlSchemaSimpleType typeNode, string strType, DataTable table, bool isBase, XmlAttribute[] attrs, bool isNillable)
Hashtable _udSimpleTypes
Definition XSDSchema.cs:65
DataColumn[] BuildKey(XmlSchemaIdentityConstraint keyNode, DataTable table)
bool IsTable(XmlSchemaElement node)
XmlSchemaSet _schemaSet
Definition XSDSchema.cs:33
void HandleSimpleContentColumn(string strType, DataTable table, bool isBase, XmlAttribute[] attrs, bool isNillable)
Dictionary< DataTable, List< DataTable > > _tableDictionary
Definition XSDSchema.cs:63
void HandleElementColumn(XmlSchemaElement elem, DataTable table, bool isBase)
string GetTableNamespace(XmlSchemaIdentityConstraint key)
DataColumn FindField(DataTable table, string field)
XmlSchemaObjectCollection _elements
Definition XSDSchema.cs:51
Hashtable _expressions
Definition XSDSchema.cs:61
string GetNamespaceFromPrefix(string prefix)
void HandleColumnExpression(object instance, XmlAttribute[] attrs)
Definition XSDSchema.cs:321
void HandleAttributes(XmlSchemaObjectCollection attributes, DataTable table, bool isBase)
Definition XSDSchema.cs:907
XmlSchemaParticle GetParticle(XmlSchemaComplexType ct)
void HandleAttributeGroup(XmlSchemaAttributeGroup attributeGroup, DataTable table, bool isBase)
Definition XSDSchema.cs:925
static void SetExtProperties(object instance, XmlAttribute[] attrs)
Definition XSDSchema.cs:282
XmlSchemaElement _dsElement
Definition XSDSchema.cs:35
ArrayList _columnExpressions
Definition XSDSchema.cs:41
Type ParseDataType(string dt)
void LoadSchema(XmlSchemaSet schemaSet, DataTable dt)
Definition XSDSchema.cs:591
Hashtable _schemaTypes
Definition XSDSchema.cs:59
void LoadSchema(XmlSchemaSet schemaSet, DataSet ds)
Definition XSDSchema.cs:600
static void SetExtProperties(object instance, XmlAttributeCollection attrs)
Definition XSDSchema.cs:359
static string GetMsdataAttribute(XmlSchemaAnnotated node, string ln)
Definition XSDSchema.cs:342
static AcceptRejectRule TranslateAcceptRejectRule(string strRule)
static bool IsXsdType(string name)
XmlSchemaObjectCollection _annotations
Definition XSDSchema.cs:49
void HandleComplexType(XmlSchemaComplexType ct, DataTable table, ArrayList tableChildren, bool isNillable)
Definition XSDSchema.cs:944
XmlSchemaElement FindDatasetElement(XmlSchemaObjectCollection elements)
Definition XSDSchema.cs:527
void HandleRefTableProperties(ArrayList RefTables, XmlSchemaElement element)
Definition XSDSchema.cs:378
static Type XsdtoClr(string xsdTypeName)
DataTable HandleTable(XmlSchemaElement node)
Hashtable _elementsTable
Definition XSDSchema.cs:55
void HandleAttributeColumn(XmlSchemaAttribute attrib, DataTable table, bool isBase)
string GetTableName(XmlSchemaIdentityConstraint key)
string GetPrefix(string ns)
void HandleConstraint(XmlSchemaIdentityConstraint keyNode)
void HandleKeyref(XmlSchemaKeyref keyref)
Hashtable _attributeGroups
Definition XSDSchema.cs:57
void AddTablesToList(List< DataTable > tableList, DataTable dt)
void HandleDataSet(XmlSchemaElement node, bool isNewDataSet)
XmlSchemaObjectCollection GetParticleItems(XmlSchemaParticle pt)
Definition XSDSchema.cs:799
static readonly NameType[] s_mapNameTypeXsd
Definition XSDSchema.cs:71
static void SetProperties(object instance, XmlAttribute[] attrs)
Definition XSDSchema.cs:217
bool GetBooleanAttribute(XmlSchemaAnnotated element, string attrName, bool defVal)
void HandleParticle(XmlSchemaParticle pt, DataTable table, ArrayList tableChildren, bool isBase)
Definition XSDSchema.cs:831
DataTable InstantiateSimpleTable(XmlSchemaElement node)
static NameType FindNameType(string name)
XmlSchemaAnnotated FindTypeNode(XmlSchemaAnnotated node)
Hashtable _attributes
Definition XSDSchema.cs:53
static Rule TranslateRule(string strRule)
Hashtable _existingSimpleTypeMap
Definition XSDSchema.cs:67
static string QualifiedName(string name)
Definition XSDSchema.cs:207
DataTable InstantiateTable(XmlSchemaElement node, XmlSchemaComplexType typeNode, bool isRef)
bool IsDatasetParticle(XmlSchemaParticle pt)
Definition XSDSchema.cs:485
void HandleRelations(XmlSchemaAnnotation ann, bool fNested)
Definition XSDSchema.cs:780
static CultureInfo CurrentCulture
static CultureInfo InvariantCulture
static ? Type GetType(string typeName, bool throwOnError, bool ignoreCase)
Definition Type.cs:408
XmlSchemaObjectCollection Constraints
static ? string DecodeName(string? name)
Definition XmlConvert.cs:55