Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DataSet.cs
Go to the documentation of this file.
7using System.IO;
11using System.Text;
13using System.Xml;
16
17namespace System.Data;
18
20[Designer("Microsoft.VSDesigner.Data.VS.DataSetDesigner, Microsoft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
21[DefaultProperty("DataSetName")]
22[ToolboxItem("Microsoft.VSDesigner.Data.VS.DataSetToolboxItem, Microsoft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
23[XmlSchemaProvider("GetDataSetSchema")]
24[XmlRoot("DataSet")]
25[TypeForwardedFrom("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
26[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
28{
29 private struct TableChanges
30 {
31 private readonly BitArray _rowChanges;
32
33 internal int HasChanges { get; set; }
34
35 internal bool this[int index]
36 {
37 get
38 {
39 return _rowChanges[index];
40 }
41 set
42 {
44 HasChanges++;
45 }
46 }
47
48 internal TableChanges(int rowCount)
49 {
51 HasChanges = 0;
52 }
53 }
54
56
58
60
62
63 private string _dataSetName = "NewDataSet";
64
65 private string _datasetPrefix = string.Empty;
66
67 internal string _namespaceURI = string.Empty;
68
69 private bool _enforceConstraints = true;
70
71 private bool _caseSensitive;
72
74
75 private bool _cultureUserSet;
76
77 internal bool _fInReadXml;
78
79 internal bool _fInLoadDiffgram;
80
81 internal bool _fTopLevelTable;
82
83 internal bool _fInitInProgress;
84
85 internal bool _fEnableCascading = true;
86
87 internal bool _fIsSchemaLoading;
88
89 private bool _fBoundToDocument;
90
91 internal string _mainTableName = string.Empty;
92
94
95 private readonly object _defaultViewManagerLock = new object();
96
97 private static int s_objectTypeCount;
98
100
102
104
105 internal bool _udtIsWrapped;
106
107 [DefaultValue(SerializationFormat.Xml)]
109 {
110 get
111 {
112 return _remotingFormat;
113 }
114 set
115 {
116 if (value != SerializationFormat.Binary && value != 0)
117 {
119 }
121 for (int i = 0; i < Tables.Count; i++)
122 {
123 Tables[i].RemotingFormat = value;
124 }
125 }
126 }
127
128 [Browsable(false)]
131 {
132 get
133 {
134 return SchemaSerializationMode.IncludeSchema;
135 }
136 set
137 {
138 if (value != SchemaSerializationMode.IncludeSchema)
139 {
141 }
142 }
143 }
144
145 [DefaultValue(false)]
146 public bool CaseSensitive
147 {
148 get
149 {
150 return _caseSensitive;
151 }
152 set
153 {
154 if (_caseSensitive == value)
155 {
156 return;
157 }
161 {
164 }
165 foreach (DataTable table in Tables)
166 {
167 table.SetCaseSensitiveValue(value, userSet: false, resetIndexes: true);
168 }
169 }
170 }
171
173
174 [Browsable(false)]
176 {
177 get
178 {
179 if (_defaultViewManager == null)
180 {
182 {
183 if (_defaultViewManager == null)
184 {
185 _defaultViewManager = new DataViewManager(this, locked: true);
186 }
187 }
188 }
189 return _defaultViewManager;
190 }
191 }
192
193 [DefaultValue(true)]
195 {
196 get
197 {
198 return _enforceConstraints;
199 }
200 set
201 {
202 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.set_EnforceConstraints|API> {0}, {1}", ObjectID, value);
203 try
204 {
206 {
207 if (value)
208 {
210 }
212 }
213 }
214 finally
215 {
216 DataCommonEventSource.Log.ExitScope(scopeId);
217 }
218 }
219 }
220
221 [DefaultValue("")]
222 public string DataSetName
223 {
224 get
225 {
226 return _dataSetName;
227 }
228 set
229 {
230 DataCommonEventSource.Log.Trace("<ds.DataSet.set_DataSetName|API> {0}, '{1}'", ObjectID, value);
231 if (value != _dataSetName)
232 {
233 if (value == null || value.Length == 0)
234 {
236 }
238 if (dataTable != null && !dataTable._fNestedInDataset)
239 {
241 }
242 RaisePropertyChanging("DataSetName");
244 }
245 }
246 }
247
248 [DefaultValue("")]
249 public string Namespace
250 {
251 get
252 {
253 return _namespaceURI;
254 }
256 set
257 {
258 DataCommonEventSource.Log.Trace("<ds.DataSet.set_Namespace|API> {0}, '{1}'", ObjectID, value);
259 if (value == null)
260 {
261 value = string.Empty;
262 }
263 if (!(value != _namespaceURI))
264 {
265 return;
266 }
267 RaisePropertyChanging("Namespace");
268 foreach (DataTable table in Tables)
269 {
270 if (table._tableNamespace == null && (table.NestedParentRelations.Length == 0 || (table.NestedParentRelations.Length == 1 && table.NestedParentRelations[0].ChildTable == table)))
271 {
272 if (Tables.Contains(table.TableName, value, checkProperty: false, caseSensitive: true))
273 {
275 }
278 }
279 }
281 if (string.IsNullOrEmpty(value))
282 {
283 _datasetPrefix = string.Empty;
284 }
285 }
286 }
287
288 [DefaultValue("")]
289 public string Prefix
290 {
291 get
292 {
293 return _datasetPrefix;
294 }
296 set
297 {
298 if (value == null)
299 {
300 value = string.Empty;
301 }
303 {
305 }
306 if (value != _datasetPrefix)
307 {
308 RaisePropertyChanging("Prefix");
310 }
311 }
312 }
313
314 [Browsable(false)]
316
317 [Browsable(false)]
318 public bool HasErrors
319 {
320 get
321 {
322 for (int i = 0; i < Tables.Count; i++)
323 {
324 if (Tables[i].HasErrors)
325 {
326 return true;
327 }
328 }
329 return false;
330 }
331 }
332
333 [Browsable(false)]
335
337 {
338 get
339 {
340 return _culture;
341 }
342 set
343 {
344 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.set_Locale|API> {0}", ObjectID);
345 try
346 {
347 if (value != null)
348 {
349 if (!_culture.Equals(value))
350 {
352 }
353 _cultureUserSet = true;
354 }
355 }
356 finally
357 {
358 DataCommonEventSource.Log.ExitScope(scopeId);
359 }
360 }
361 }
362
363 [Browsable(false)]
365 public override ISite? Site
366 {
367 get
368 {
369 return base.Site;
370 }
371 set
372 {
373 ISite site = Site;
374 if (value == null && site != null)
375 {
376 IContainer container = site.Container;
377 if (container != null)
378 {
379 for (int i = 0; i < Tables.Count; i++)
380 {
381 if (Tables[i].Site != null)
382 {
383 container.Remove(Tables[i]);
384 }
385 }
386 }
387 }
389 }
390 }
391
394
397
398 internal bool FBoundToDocument
399 {
400 get
401 {
402 return _fBoundToDocument;
403 }
404 set
405 {
407 }
408 }
409
410 internal string MainTableName
411 {
412 get
413 {
414 return _mainTableName;
415 }
416 set
417 {
419 }
420 }
421
422 internal int ObjectID => _objectID;
423
424 internal event PropertyChangedEventHandler? PropertyChanging;
425
427
429
431
432 public event EventHandler? Initialized;
433
434 public DataSet()
435 {
436 GC.SuppressFinalize(this);
437 DataCommonEventSource.Log.Trace("<ds.DataSet.DataSet|API> {0}", ObjectID);
441 }
442
443 public DataSet(string dataSetName)
444 : this()
445 {
447 }
448
450 {
453 while (enumerator.MoveNext())
454 {
455 if (enumerator.Name == "DataSet.RemotingFormat")
456 {
458 break;
459 }
460 }
462 }
463
465 {
468 while (enumerator.MoveNext())
469 {
470 if (enumerator.Name == "SchemaSerializationMode.DataSet")
471 {
472 result = (SchemaSerializationMode)enumerator.Value;
473 break;
474 }
475 }
476 return result;
477 }
478
480 {
482 reader.MoveToContent();
483 if (reader.NodeType == XmlNodeType.Element && reader.HasAttributes)
484 {
485 string attribute = reader.GetAttribute("SchemaSerializationMode", "urn:schemas-microsoft-com:xml-msdata");
486 if (string.Equals(attribute, "ExcludeSchema", StringComparison.OrdinalIgnoreCase))
487 {
488 result = SchemaSerializationMode.ExcludeSchema;
489 }
490 else if (string.Equals(attribute, "IncludeSchema", StringComparison.OrdinalIgnoreCase))
491 {
492 result = SchemaSerializationMode.IncludeSchema;
493 }
494 else if (attribute != null)
495 {
497 }
498 }
499 return result;
500 }
501
502 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
504 {
507 while (enumerator.MoveNext())
508 {
509 if (enumerator.Name == "DataSet.RemotingFormat")
510 {
512 break;
513 }
514 }
516 }
517
518 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
519 [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2112:ReflectionToRequiresUnreferencedCode", Justification = "CreateInstanceOfThisType's use of GetType uses only the parameterless constructor, but the annotations preserve all non-public constructors causing a warning for the serialization constructors. Those constructors won't be used here.")]
521 : this(info, context, ConstructSchema: true)
522 {
523 }
524
525 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
526 [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2112:ReflectionToRequiresUnreferencedCode", Justification = "CreateInstanceOfThisType's use of GetType uses only the parameterless constructor, but the annotations preserve all non-public constructors causing a warning for the serialization constructors. Those constructors won't be used here.")]
528 : this()
529 {
533 while (enumerator.MoveNext())
534 {
535 string name = enumerator.Name;
536 if (!(name == "DataSet.RemotingFormat"))
537 {
538 if (name == "SchemaSerializationMode.DataSet")
539 {
541 }
542 }
543 else
544 {
546 }
547 }
549 {
551 }
553 {
555 }
556 }
557
558 [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "Binary serialization is unsafe in general and is planned to be obsoleted. We do not want to mark interface or ctors of this class as unsafe as that would show many unnecessary warnings elsewhere.")]
564
565 protected virtual void InitializeDerivedDataSet()
566 {
567 }
568
569 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
571 {
572 info.AddValue("DataSet.RemotingVersion", new Version(2, 0));
573 if (remotingFormat != 0)
574 {
575 info.AddValue("DataSet.RemotingFormat", remotingFormat);
576 }
578 {
579 info.AddValue("SchemaSerializationMode.DataSet", SchemaSerializationMode);
580 }
581 if (remotingFormat != 0)
582 {
584 {
586 info.AddValue("DataSet.Tables.Count", Tables.Count);
587 for (int i = 0; i < Tables.Count; i++)
588 {
591 binaryFormatter.Serialize(memoryStream, Tables[i]);
593 info.AddValue(string.Format(CultureInfo.InvariantCulture, "DataSet.Tables_{0}", i), memoryStream.GetBuffer());
594 }
595 for (int j = 0; j < Tables.Count; j++)
596 {
597 Tables[j].SerializeConstraints(info, context, j, allConstraints: true);
598 }
599 SerializeRelations(info, context);
600 for (int k = 0; k < Tables.Count; k++)
601 {
602 Tables[k].SerializeExpressionColumns(info, context, k);
603 }
604 }
605 else
606 {
608 }
609 for (int l = 0; l < Tables.Count; l++)
610 {
611 Tables[l].SerializeTableData(info, context, l);
612 }
613 }
614 else
615 {
617 string text = null;
618 info.AddValue("XmlSchema", xmlSchemaForRemoting);
622 WriteXml(writer, XmlWriteMode.DiffGram);
623 text = stringWriter.ToString();
624 info.AddValue("XmlDiffGram", text);
625 }
626 }
627
628 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
634
635 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
637 {
638 if (remotingFormat != 0)
639 {
641 {
643 int @int = info.GetInt32("DataSet.Tables.Count");
644 for (int i = 0; i < @int; i++)
645 {
646 byte[] buffer = (byte[])info.GetValue(string.Format(CultureInfo.InvariantCulture, "DataSet.Tables_{0}", i), typeof(byte[]));
650 DataTable table = (DataTable)binaryFormatter.Deserialize(memoryStream);
651 Tables.Add(table);
652 }
653 for (int j = 0; j < @int; j++)
654 {
655 Tables[j].DeserializeConstraints(info, context, j, allConstraints: true);
656 }
657 DeserializeRelations(info, context);
658 for (int k = 0; k < @int; k++)
659 {
660 Tables[k].DeserializeExpressionColumns(info, context, k);
661 }
662 }
663 else
664 {
666 }
667 }
668 else
669 {
670 string text = (string)info.GetValue("XmlSchema", typeof(string));
671 if (text != null)
672 {
674 }
675 }
676 }
677
678 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
680 {
681 if (remotingFormat != 0)
682 {
683 for (int i = 0; i < Tables.Count; i++)
684 {
685 Tables[i].DeserializeTableData(info, context, i);
686 }
687 return;
688 }
689 string text = (string)info.GetValue("XmlDiffGram", typeof(string));
690 if (text != null)
691 {
693 }
694 }
695
697 {
698 info.AddValue("DataSet.DataSetName", DataSetName);
699 info.AddValue("DataSet.Namespace", Namespace);
700 info.AddValue("DataSet.Prefix", Prefix);
701 info.AddValue("DataSet.CaseSensitive", CaseSensitive);
702 info.AddValue("DataSet.LocaleLCID", Locale.LCID);
703 info.AddValue("DataSet.EnforceConstraints", EnforceConstraints);
704 info.AddValue("DataSet.ExtendedProperties", ExtendedProperties);
705 }
706
708 {
709 _dataSetName = info.GetString("DataSet.DataSetName");
710 _namespaceURI = info.GetString("DataSet.Namespace");
711 _datasetPrefix = info.GetString("DataSet.Prefix");
712 _caseSensitive = info.GetBoolean("DataSet.CaseSensitive");
713 int culture = (int)info.GetValue("DataSet.LocaleLCID", typeof(int));
715 _cultureUserSet = true;
716 _enforceConstraints = info.GetBoolean("DataSet.EnforceConstraints");
717 _extendedProperties = (PropertyCollection)info.GetValue("DataSet.ExtendedProperties", typeof(PropertyCollection));
718 }
719
721 {
723 foreach (DataRelation relation in Relations)
724 {
725 int[] array = new int[relation.ParentColumns.Length + 1];
726 array[0] = Tables.IndexOf(relation.ParentTable);
727 for (int i = 1; i < array.Length; i++)
728 {
729 array[i] = relation.ParentColumns[i - 1].Ordinal;
730 }
731 int[] array2 = new int[relation.ChildColumns.Length + 1];
732 array2[0] = Tables.IndexOf(relation.ChildTable);
733 for (int j = 1; j < array2.Length; j++)
734 {
735 array2[j] = relation.ChildColumns[j - 1].Ordinal;
736 }
738 arrayList2.Add(relation.RelationName);
741 arrayList2.Add(relation.Nested);
742 arrayList2.Add(relation._extendedProperties);
744 }
745 info.AddValue("DataSet.Relations", arrayList);
746 }
747
749 {
750 ArrayList arrayList = (ArrayList)info.GetValue("DataSet.Relations", typeof(ArrayList));
751 foreach (ArrayList item in arrayList)
752 {
753 string relationName = (string)item[0];
754 int[] array = (int[])item[1];
755 int[] array2 = (int[])item[2];
756 bool nested = (bool)item[3];
759 for (int i = 0; i < array3.Length; i++)
760 {
761 array3[i] = Tables[array[0]].Columns[array[i + 1]];
762 }
764 for (int j = 0; j < array4.Length; j++)
765 {
766 array4[j] = Tables[array2[0]].Columns[array2[j + 1]];
767 }
774 }
775 }
776
778 {
779 EnforceConstraints = false;
781 }
782
784 {
786 }
787
788 internal void EnableConstraints()
789 {
790 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.EnableConstraints|INFO> {0}", ObjectID);
791 try
792 {
793 bool flag = false;
795 while (constraintEnumerator.GetNext())
796 {
797 Constraint constraint = constraintEnumerator.GetConstraint();
798 flag |= constraint.IsConstraintViolated();
799 }
800 foreach (DataTable table in Tables)
801 {
802 foreach (DataColumn column in table.Columns)
803 {
804 if (!column.AllowDBNull)
805 {
806 flag |= column.IsNotAllowDBNullViolated();
807 }
808 if (column.MaxLength >= 0)
809 {
810 flag |= column.IsMaxLengthViolated();
811 }
812 }
813 }
814 if (flag)
815 {
817 }
818 }
819 finally
820 {
821 DataCommonEventSource.Log.ExitScope(scopeId);
822 }
823 }
824
826 {
827 bool flag = false;
828 bool flag2 = false;
829 int num = 0;
832 try
833 {
834 _culture = value;
836 foreach (DataTable table in Tables)
837 {
838 if (!table.ShouldSerializeLocale())
839 {
840 table.SetLocaleValue(value, userSet: false, resetIndexes: false);
841 }
842 }
844 if (!flag)
845 {
846 return;
847 }
848 flag = false;
849 foreach (DataTable table2 in Tables)
850 {
851 num++;
852 if (!table2.ShouldSerializeLocale())
853 {
854 table2.SetLocaleValue(value, userSet: false, resetIndexes: true);
855 }
856 }
857 flag = true;
858 }
859 catch
860 {
861 flag2 = true;
862 throw;
863 }
864 finally
865 {
866 if (!flag)
867 {
870 foreach (DataTable table3 in Tables)
871 {
872 if (!table3.ShouldSerializeLocale())
873 {
874 table3.SetLocaleValue(culture, userSet: false, resetIndexes: false);
875 }
876 }
877 try
878 {
879 for (int i = 0; i < num; i++)
880 {
882 {
883 Tables[i].SetLocaleValue(culture, userSet: false, resetIndexes: true);
884 }
885 }
886 }
888 {
890 }
891 if (!flag2)
892 {
894 }
895 }
896 }
897 }
898
899 internal bool ShouldSerializeLocale()
900 {
901 return _cultureUserSet;
902 }
903
904 protected virtual bool ShouldSerializeRelations()
905 {
906 return true;
907 }
908
909 protected virtual bool ShouldSerializeTables()
910 {
911 return true;
912 }
913
914 public void AcceptChanges()
915 {
916 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.AcceptChanges|API> {0}", ObjectID);
917 try
918 {
919 for (int i = 0; i < Tables.Count; i++)
920 {
921 Tables[i].AcceptChanges();
922 }
923 }
924 finally
925 {
926 DataCommonEventSource.Log.ExitScope(scopeId);
927 }
928 }
929
930 public void BeginInit()
931 {
932 _fInitInProgress = true;
933 }
934
935 public void EndInit()
936 {
938 for (int i = 0; i < Tables.Count; i++)
939 {
940 Tables[i].Columns.FinishInitCollection();
941 }
942 for (int j = 0; j < Tables.Count; j++)
943 {
944 Tables[j].Constraints.FinishInitConstraints();
945 }
947 _fInitInProgress = false;
949 }
950
951 public void Clear()
952 {
953 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.Clear|API> {0}", ObjectID);
954 try
955 {
958 EnforceConstraints = false;
959 for (int i = 0; i < Tables.Count; i++)
960 {
961 Tables[i].Clear();
962 }
964 }
965 finally
966 {
967 DataCommonEventSource.Log.ExitScope(scopeId);
968 }
969 }
970
972 {
973 return (DataSet)Activator.CreateInstance(GetType(), nonPublic: true);
974 }
975
976 [MethodImpl(MethodImplOptions.NoInlining)]
977 public virtual DataSet Clone()
978 {
979 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.Clone|API> {0}", ObjectID);
980 try
981 {
983 if (dataSet.Tables.Count > 0)
984 {
985 dataSet.Reset();
986 }
997 for (int i = 0; i < tables.Count; i++)
998 {
999 DataTable dataTable = tables[i].Clone(dataSet);
1000 dataTable._tableNamespace = tables[i].Namespace;
1001 dataSet.Tables.Add(dataTable);
1002 }
1003 for (int j = 0; j < tables.Count; j++)
1004 {
1006 for (int k = 0; k < constraints.Count; k++)
1007 {
1009 {
1011 if (foreignKeyConstraint.Table != foreignKeyConstraint.RelatedTable)
1012 {
1013 dataSet.Tables[j].Constraints.Add(constraints[k].Clone(dataSet));
1014 }
1015 }
1016 }
1017 }
1019 for (int l = 0; l < relations.Count; l++)
1020 {
1023 dataSet.Relations.Add(dataRelation);
1025 }
1026 if (_extendedProperties != null)
1027 {
1028 foreach (object key in _extendedProperties.Keys)
1029 {
1030 dataSet.ExtendedProperties[key] = _extendedProperties[key];
1031 }
1032 }
1033 foreach (DataTable table in Tables)
1034 {
1035 foreach (DataColumn column in table.Columns)
1036 {
1037 if (column.Expression.Length != 0)
1038 {
1039 dataSet.Tables[table.TableName, table.Namespace].Columns[column.ColumnName].CopyExpressionFrom(column);
1040 }
1041 }
1042 }
1043 for (int m = 0; m < tables.Count; m++)
1044 {
1045 dataSet.Tables[m]._tableNamespace = tables[m]._tableNamespace;
1046 }
1048 return dataSet;
1049 }
1050 finally
1051 {
1052 DataCommonEventSource.Log.ExitScope(scopeId);
1053 }
1054 }
1055
1056 public DataSet Copy()
1057 {
1058 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.Copy|API> {0}", ObjectID);
1059 try
1060 {
1061 DataSet dataSet = Clone();
1062 bool enforceConstraints = dataSet.EnforceConstraints;
1064 foreach (DataTable table2 in Tables)
1065 {
1066 DataTable table = dataSet.Tables[table2.TableName, table2.Namespace];
1067 foreach (DataRow row in table2.Rows)
1068 {
1069 table2.CopyRow(table, row);
1070 }
1071 }
1073 return dataSet;
1074 }
1075 finally
1076 {
1077 DataCommonEventSource.Log.ExitScope(scopeId);
1078 }
1079 }
1080
1082 {
1083 int num = 100;
1084 for (int i = 0; i < Tables.Count; i++)
1085 {
1086 int num2 = Tables[i].TableName.Length + 4 << 2;
1088 for (int j = 0; j < dataTable.Columns.Count; j++)
1089 {
1090 num2 += dataTable.Columns[j].ColumnName.Length + 4 << 2;
1091 num2 += 20;
1092 }
1093 num += dataTable.Rows.Count * num2;
1094 }
1095 return num;
1096 }
1097
1099 {
1100 return GetChanges(DataRowState.Added | DataRowState.Deleted | DataRowState.Modified);
1101 }
1102
1104 {
1105 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.GetChanges|API> {0}, rowStates={1}", ObjectID, rowStates);
1106 try
1107 {
1108 DataSet dataSet = null;
1109 bool enforceConstraints = false;
1110 if (((uint)rowStates & 0xFFFFFFE1u) != 0)
1111 {
1113 }
1115 for (int i = 0; i < array.Length; i++)
1116 {
1117 array[i] = new TableChanges(Tables[i].Rows.Count);
1118 }
1120 for (int j = 0; j < array.Length; j++)
1121 {
1122 if (0 >= array[j].HasChanges)
1123 {
1124 continue;
1125 }
1126 if (dataSet == null)
1127 {
1128 dataSet = Clone();
1129 enforceConstraints = dataSet.EnforceConstraints;
1131 }
1133 DataTable table = dataSet.Tables[dataTable.TableName, dataTable.Namespace];
1134 int num = 0;
1135 while (0 < array[j].HasChanges)
1136 {
1137 if (array[j][num])
1138 {
1139 dataTable.CopyRow(table, dataTable.Rows[num]);
1140 array[j].HasChanges--;
1141 }
1142 num++;
1143 }
1144 }
1145 if (dataSet != null)
1146 {
1148 }
1149 return dataSet;
1150 }
1151 finally
1152 {
1153 DataCommonEventSource.Log.ExitScope(scopeId);
1154 }
1155 }
1156
1158 {
1159 for (int i = 0; i < bitMatrix.Length; i++)
1160 {
1161 DataRowCollection rows = Tables[i].Rows;
1162 int count = rows.Count;
1163 for (int j = 0; j < count; j++)
1164 {
1165 DataRow dataRow = rows[j];
1166 DataRowState rowState = dataRow.RowState;
1167 if ((rowStates & rowState) != 0 && !bitMatrix[i][j])
1168 {
1169 bitMatrix[i][j] = true;
1170 if (DataRowState.Deleted != rowState)
1171 {
1173 }
1174 }
1175 }
1176 }
1177 }
1178
1180 {
1181 DataRelationCollection parentRelations = row.Table.ParentRelations;
1183 for (int i = 0; i < count; i++)
1184 {
1185 DataRow[] parentRows = row.GetParentRows(parentRelations[i], DataRowVersion.Current);
1187 foreach (DataRow dataRow in array)
1188 {
1189 int num = Tables.IndexOf(dataRow.Table);
1190 int index = dataRow.Table.Rows.IndexOf(dataRow);
1191 if (!bitMatrix[num][index])
1192 {
1193 bitMatrix[num][index] = true;
1194 if (DataRowState.Deleted != dataRow.RowState)
1195 {
1197 }
1198 }
1199 }
1200 }
1201 }
1202
1204 {
1205 return DefaultViewManager;
1206 }
1207
1208 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1209 internal string GetRemotingDiffGram(DataTable table)
1210 {
1214 new NewDiffgramGen(table, writeHierarchy: false).Save(xmlTextWriter, table);
1215 return stringWriter.ToString();
1216 }
1217
1218 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1219 public string GetXml()
1220 {
1221 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.GetXml|API> {0}", ObjectID);
1222 try
1223 {
1228 return stringWriter.ToString();
1229 }
1230 finally
1231 {
1232 DataCommonEventSource.Log.ExitScope(scopeId);
1233 }
1234 }
1235
1236 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1237 public string GetXmlSchema()
1238 {
1239 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.GetXmlSchema|API> {0}", ObjectID);
1240 try
1241 {
1245 new XmlTreeGen(SchemaFormat.Public).Save(this, xmlTextWriter);
1246 return stringWriter.ToString();
1247 }
1248 finally
1249 {
1250 DataCommonEventSource.Log.ExitScope(scopeId);
1251 }
1252 }
1253
1254 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1255 internal string GetXmlSchemaForRemoting(DataTable table)
1256 {
1260 if (table == null)
1261 {
1263 {
1264 new XmlTreeGen(SchemaFormat.RemotingSkipSchema).Save(this, xmlTextWriter);
1265 }
1266 else
1267 {
1268 new XmlTreeGen(SchemaFormat.Remoting).Save(this, xmlTextWriter);
1269 }
1270 }
1271 else
1272 {
1273 new XmlTreeGen(SchemaFormat.Remoting).Save(table, xmlTextWriter);
1274 }
1275 return stringWriter.ToString();
1276 }
1277
1278 public bool HasChanges()
1279 {
1280 return HasChanges(DataRowState.Added | DataRowState.Deleted | DataRowState.Modified);
1281 }
1282
1284 {
1285 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.HasChanges|API> {0}, rowStates={1}", ObjectID, (int)rowStates);
1286 try
1287 {
1288 if (((uint)rowStates & 0xFFFFFFE0u) != 0)
1289 {
1290 throw ExceptionBuilder.ArgumentOutOfRange("rowState");
1291 }
1292 for (int i = 0; i < Tables.Count; i++)
1293 {
1295 for (int j = 0; j < dataTable.Rows.Count; j++)
1296 {
1297 DataRow dataRow = dataTable.Rows[j];
1298 if ((dataRow.RowState & rowStates) != 0)
1299 {
1300 return true;
1301 }
1302 }
1303 }
1304 return false;
1305 }
1306 finally
1307 {
1308 DataCommonEventSource.Log.ExitScope(scopeId);
1309 }
1310 }
1311
1312 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1313 public void InferXmlSchema(XmlReader? reader, string[]? nsArray)
1314 {
1315 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.InferXmlSchema|API> {0}", ObjectID);
1316 try
1317 {
1318 if (reader != null)
1319 {
1321 if (reader.NodeType == XmlNodeType.Element)
1322 {
1323 XmlNode newChild = xmlDocument.ReadNode(reader);
1324 xmlDocument.AppendChild(newChild);
1325 }
1326 else
1327 {
1328 xmlDocument.Load(reader);
1329 }
1330 if (xmlDocument.DocumentElement != null)
1331 {
1333 }
1334 }
1335 }
1336 finally
1337 {
1338 DataCommonEventSource.Log.ExitScope(scopeId);
1339 }
1340 }
1341
1342 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1343 public void InferXmlSchema(Stream? stream, string[]? nsArray)
1344 {
1345 if (stream != null)
1346 {
1348 }
1349 }
1350
1351 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1352 public void InferXmlSchema(TextReader? reader, string[]? nsArray)
1353 {
1354 if (reader != null)
1355 {
1356 InferXmlSchema(new XmlTextReader(reader), nsArray);
1357 }
1358 }
1359
1360 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1361 public void InferXmlSchema(string fileName, string[]? nsArray)
1362 {
1364 try
1365 {
1367 }
1368 finally
1369 {
1370 xmlTextReader.Close();
1371 }
1372 }
1373
1374 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1375 public void ReadXmlSchema(XmlReader? reader)
1376 {
1377 ReadXmlSchema(reader, denyResolving: false);
1378 }
1379
1380 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1381 internal void ReadXmlSchema(XmlReader reader, bool denyResolving)
1382 {
1383 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.ReadXmlSchema|INFO> {0}, reader, denyResolving={1}", ObjectID, denyResolving);
1384 try
1385 {
1386 int depth = -1;
1387 if (reader == null)
1388 {
1389 return;
1390 }
1391 if (reader is XmlTextReader)
1392 {
1393 ((XmlTextReader)reader).WhitespaceHandling = WhitespaceHandling.None;
1394 }
1396 if (reader.NodeType == XmlNodeType.Element)
1397 {
1398 depth = reader.Depth;
1399 }
1400 reader.MoveToContent();
1401 if (reader.NodeType != XmlNodeType.Element)
1402 {
1403 return;
1404 }
1405 if (reader.LocalName == "Schema" && reader.NamespaceURI == "urn:schemas-microsoft-com:xml-data")
1406 {
1407 ReadXDRSchema(reader);
1408 return;
1409 }
1410 if (reader.LocalName == "schema" && reader.NamespaceURI == "http://www.w3.org/2001/XMLSchema")
1411 {
1413 return;
1414 }
1415 if (reader.LocalName == "schema" && reader.NamespaceURI.StartsWith("http://www.w3.org/", StringComparison.Ordinal))
1416 {
1417 throw ExceptionBuilder.DataSetUnsupportedSchema("http://www.w3.org/2001/XMLSchema");
1418 }
1419 XmlElement xmlElement = xmlDocument.CreateElement(reader.Prefix, reader.LocalName, reader.NamespaceURI);
1420 if (reader.HasAttributes)
1421 {
1422 int attributeCount = reader.AttributeCount;
1423 for (int i = 0; i < attributeCount; i++)
1424 {
1425 reader.MoveToAttribute(i);
1426 if (reader.NamespaceURI.Equals("http://www.w3.org/2000/xmlns/"))
1427 {
1428 xmlElement.SetAttribute(reader.Name, reader.GetAttribute(i));
1429 continue;
1430 }
1431 XmlAttribute xmlAttribute = xmlElement.SetAttributeNode(reader.LocalName, reader.NamespaceURI);
1432 xmlAttribute.Prefix = reader.Prefix;
1433 xmlAttribute.Value = reader.GetAttribute(i);
1434 }
1435 }
1436 reader.Read();
1437 while (MoveToElement(reader, depth))
1438 {
1439 if (reader.LocalName == "Schema" && reader.NamespaceURI == "urn:schemas-microsoft-com:xml-data")
1440 {
1441 ReadXDRSchema(reader);
1442 return;
1443 }
1444 if (reader.LocalName == "schema" && reader.NamespaceURI == "http://www.w3.org/2001/XMLSchema")
1445 {
1447 return;
1448 }
1449 if (reader.LocalName == "schema" && reader.NamespaceURI.StartsWith("http://www.w3.org/", StringComparison.Ordinal))
1450 {
1451 throw ExceptionBuilder.DataSetUnsupportedSchema("http://www.w3.org/2001/XMLSchema");
1452 }
1453 XmlNode newChild = xmlDocument.ReadNode(reader);
1454 xmlElement.AppendChild(newChild);
1455 }
1456 ReadEndElement(reader);
1457 xmlDocument.AppendChild(xmlElement);
1458 InferSchema(xmlDocument, null, XmlReadMode.Auto);
1459 }
1460 finally
1461 {
1462 DataCommonEventSource.Log.ExitScope(scopeId);
1463 }
1464 }
1465
1466 internal bool MoveToElement(XmlReader reader, int depth)
1467 {
1468 while (!reader.EOF && reader.NodeType != XmlNodeType.EndElement && reader.NodeType != XmlNodeType.Element && reader.Depth > depth)
1469 {
1470 reader.Read();
1471 }
1472 return reader.NodeType == XmlNodeType.Element;
1473 }
1474
1475 private static void MoveToElement(XmlReader reader)
1476 {
1477 while (!reader.EOF && reader.NodeType != XmlNodeType.EndElement && reader.NodeType != XmlNodeType.Element)
1478 {
1479 reader.Read();
1480 }
1481 }
1482
1483 internal void ReadEndElement(XmlReader reader)
1484 {
1485 while (reader.NodeType == XmlNodeType.Whitespace)
1486 {
1487 reader.Skip();
1488 }
1489 if (reader.NodeType == XmlNodeType.None)
1490 {
1491 reader.Skip();
1492 }
1493 else if (reader.NodeType == XmlNodeType.EndElement)
1494 {
1495 reader.ReadEndElement();
1496 }
1497 }
1498
1499 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1500 internal void ReadXSDSchema(XmlReader reader, bool denyResolving)
1501 {
1503 int num = 1;
1504 if (reader.LocalName == "schema" && reader.NamespaceURI == "http://www.w3.org/2001/XMLSchema" && reader.HasAttributes)
1505 {
1506 string attribute = reader.GetAttribute("schemafragmentcount", "urn:schemas-microsoft-com:xml-msdata");
1507 if (!string.IsNullOrEmpty(attribute))
1508 {
1509 num = int.Parse(attribute, null);
1510 }
1511 }
1512 while (reader.LocalName == "schema" && reader.NamespaceURI == "http://www.w3.org/2001/XMLSchema")
1513 {
1514 XmlSchema schema = XmlSchema.Read(reader, null);
1516 ReadEndElement(reader);
1517 if (--num > 0)
1518 {
1519 MoveToElement(reader);
1520 }
1521 while (reader.NodeType == XmlNodeType.Whitespace)
1522 {
1523 reader.Skip();
1524 }
1525 }
1526 xmlSchemaSet.Compile();
1528 xSDSchema.LoadSchema(xmlSchemaSet, this);
1529 }
1530
1531 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1532 internal void ReadXDRSchema(XmlReader reader)
1533 {
1535 XmlNode xmlNode = xmlDocument.ReadNode(reader);
1536 xmlDocument.AppendChild(xmlNode);
1537 XDRSchema xDRSchema = new XDRSchema(this, fInline: false);
1538 DataSetName = xmlDocument.DocumentElement.LocalName;
1539 xDRSchema.LoadSchema((XmlElement)xmlNode, this);
1540 }
1541
1542 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1544 {
1545 if (stream != null)
1546 {
1548 }
1549 }
1550
1551 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1552 public void ReadXmlSchema(TextReader? reader)
1553 {
1554 if (reader != null)
1555 {
1556 ReadXmlSchema(new XmlTextReader(reader), denyResolving: false);
1557 }
1558 }
1559
1560 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1561 public void ReadXmlSchema(string fileName)
1562 {
1564 try
1565 {
1567 }
1568 finally
1569 {
1570 xmlTextReader.Close();
1571 }
1572 }
1573
1574 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1576 {
1577 WriteXmlSchema(stream, SchemaFormat.Public, null);
1578 }
1579
1580 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1586
1587 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1588 public void WriteXmlSchema(string fileName)
1589 {
1590 WriteXmlSchema(fileName, SchemaFormat.Public, null);
1591 }
1592
1593 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1599
1600 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1602 {
1603 WriteXmlSchema(writer, SchemaFormat.Public, null);
1604 }
1605
1606 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1612
1613 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1615 {
1616 WriteXmlSchema(writer, SchemaFormat.Public, null);
1617 }
1618
1619 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1625
1626 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1628 {
1630 try
1631 {
1633 xmlTextWriter.WriteStartDocument(standalone: true);
1635 xmlTextWriter.WriteEndDocument();
1636 }
1637 finally
1638 {
1639 xmlTextWriter.Close();
1640 }
1641 }
1642
1643 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1653
1654 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1664
1665 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1667 {
1668 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.WriteXmlSchema|INFO> {0}, schemaFormat={1}", ObjectID, schemaFormat);
1669 try
1670 {
1671 if (writer != null)
1672 {
1673 XmlTreeGen xmlTreeGen = null;
1675 xmlTreeGen.Save(this, null, writer, writeHierarchy: false, multipleTargetConverter);
1676 }
1677 }
1678 finally
1679 {
1680 DataCommonEventSource.Log.ExitScope(scopeId);
1681 }
1682 }
1683
1684 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1686 {
1687 return ReadXml(reader, denyResolving: false);
1688 }
1689
1690 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1692 {
1693 IDisposable disposable = null;
1694 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.ReadXml|INFO> {0}, denyResolving={1}", ObjectID, denyResolving);
1695 try
1696 {
1699 try
1700 {
1701 bool flag = false;
1702 bool flag2 = false;
1703 bool flag3 = false;
1704 bool isXdr = false;
1705 int depth = -1;
1706 XmlReadMode result = XmlReadMode.Auto;
1707 bool flag4 = false;
1708 bool flag5 = false;
1709 dSRowDiffIdUsageSection.Prepare(this);
1710 if (reader == null)
1711 {
1712 return result;
1713 }
1714 if (Tables.Count == 0)
1715 {
1716 flag4 = true;
1717 }
1718 if (reader is XmlTextReader)
1719 {
1720 ((XmlTextReader)reader).WhitespaceHandling = WhitespaceHandling.Significant;
1721 }
1724 reader.MoveToContent();
1725 if (reader.NodeType == XmlNodeType.Element)
1726 {
1727 depth = reader.Depth;
1728 }
1729 if (reader.NodeType == XmlNodeType.Element)
1730 {
1731 if (reader.LocalName == "diffgram" && reader.NamespaceURI == "urn:schemas-microsoft-com:xml-diffgram-v1")
1732 {
1733 ReadXmlDiffgram(reader);
1734 ReadEndElement(reader);
1735 return XmlReadMode.DiffGram;
1736 }
1737 if (reader.LocalName == "Schema" && reader.NamespaceURI == "urn:schemas-microsoft-com:xml-data")
1738 {
1739 ReadXDRSchema(reader);
1740 return XmlReadMode.ReadSchema;
1741 }
1742 if (reader.LocalName == "schema" && reader.NamespaceURI == "http://www.w3.org/2001/XMLSchema")
1743 {
1745 return XmlReadMode.ReadSchema;
1746 }
1747 if (reader.LocalName == "schema" && reader.NamespaceURI.StartsWith("http://www.w3.org/", StringComparison.Ordinal))
1748 {
1749 throw ExceptionBuilder.DataSetUnsupportedSchema("http://www.w3.org/2001/XMLSchema");
1750 }
1751 XmlElement xmlElement = xmlDocument.CreateElement(reader.Prefix, reader.LocalName, reader.NamespaceURI);
1752 if (reader.HasAttributes)
1753 {
1754 int attributeCount = reader.AttributeCount;
1755 for (int i = 0; i < attributeCount; i++)
1756 {
1757 reader.MoveToAttribute(i);
1758 if (reader.NamespaceURI.Equals("http://www.w3.org/2000/xmlns/"))
1759 {
1760 xmlElement.SetAttribute(reader.Name, reader.GetAttribute(i));
1761 continue;
1762 }
1763 XmlAttribute xmlAttribute = xmlElement.SetAttributeNode(reader.LocalName, reader.NamespaceURI);
1764 xmlAttribute.Prefix = reader.Prefix;
1765 xmlAttribute.Value = reader.GetAttribute(i);
1766 }
1767 }
1768 reader.Read();
1769 string value = reader.Value;
1770 while (MoveToElement(reader, depth))
1771 {
1772 if (reader.LocalName == "diffgram" && reader.NamespaceURI == "urn:schemas-microsoft-com:xml-diffgram-v1")
1773 {
1774 ReadXmlDiffgram(reader);
1775 result = XmlReadMode.DiffGram;
1776 }
1777 if (!flag2 && !flag && reader.LocalName == "Schema" && reader.NamespaceURI == "urn:schemas-microsoft-com:xml-data")
1778 {
1779 ReadXDRSchema(reader);
1780 flag2 = true;
1781 isXdr = true;
1782 continue;
1783 }
1784 if (reader.LocalName == "schema" && reader.NamespaceURI == "http://www.w3.org/2001/XMLSchema")
1785 {
1787 flag2 = true;
1788 continue;
1789 }
1790 if (reader.LocalName == "schema" && reader.NamespaceURI.StartsWith("http://www.w3.org/", StringComparison.Ordinal))
1791 {
1792 throw ExceptionBuilder.DataSetUnsupportedSchema("http://www.w3.org/2001/XMLSchema");
1793 }
1794 if (reader.LocalName == "diffgram" && reader.NamespaceURI == "urn:schemas-microsoft-com:xml-diffgram-v1")
1795 {
1796 ReadXmlDiffgram(reader);
1797 flag3 = true;
1798 result = XmlReadMode.DiffGram;
1799 continue;
1800 }
1801 while (!reader.EOF && reader.NodeType == XmlNodeType.Whitespace)
1802 {
1803 reader.Read();
1804 }
1805 if (reader.NodeType != XmlNodeType.Element)
1806 {
1807 continue;
1808 }
1809 flag = true;
1810 if (!flag2 && Tables.Count == 0)
1811 {
1812 XmlNode newChild = xmlDocument.ReadNode(reader);
1813 xmlElement.AppendChild(newChild);
1814 continue;
1815 }
1816 if (xmlDataLoader == null)
1817 {
1819 }
1820 xmlDataLoader.LoadData(reader);
1821 flag5 = true;
1822 result = (flag2 ? XmlReadMode.ReadSchema : XmlReadMode.IgnoreSchema);
1823 }
1824 ReadEndElement(reader);
1825 bool flag6 = false;
1827 if (!flag2 && Tables.Count == 0 && !xmlElement.HasChildNodes)
1828 {
1829 _fTopLevelTable = true;
1830 flag6 = true;
1831 if (value != null && value.Length > 0)
1832 {
1834 }
1835 }
1836 if (!flag4 && value != null && value.Length > 0)
1837 {
1839 }
1840 xmlDocument.AppendChild(xmlElement);
1841 if (xmlDataLoader == null)
1842 {
1844 }
1845 if (!flag4 && !flag5)
1846 {
1847 XmlElement documentElement = xmlDocument.DocumentElement;
1848 if (documentElement.ChildNodes.Count == 0 || (documentElement.ChildNodes.Count == 1 && documentElement.FirstChild.GetType() == typeof(XmlText)))
1849 {
1851 if (DataSetName != documentElement.Name && _namespaceURI != documentElement.NamespaceURI && Tables.Contains(documentElement.Name, (documentElement.NamespaceURI.Length == 0) ? null : documentElement.NamespaceURI, checkProperty: false, caseSensitive: true))
1852 {
1853 _fTopLevelTable = true;
1854 }
1855 try
1856 {
1857 xmlDataLoader.LoadData(xmlDocument);
1858 }
1859 finally
1860 {
1862 }
1863 }
1864 }
1865 if (!flag3)
1866 {
1867 if (!flag2 && Tables.Count == 0)
1868 {
1869 InferSchema(xmlDocument, null, XmlReadMode.Auto);
1870 result = XmlReadMode.InferSchema;
1872 try
1873 {
1874 xmlDataLoader.LoadData(xmlDocument);
1875 }
1876 finally
1877 {
1879 }
1880 }
1881 if (flag6)
1882 {
1884 }
1885 }
1886 }
1887 return result;
1888 }
1889 finally
1890 {
1891 }
1892 }
1893 finally
1894 {
1895 disposable?.Dispose();
1896 DataCommonEventSource.Log.ExitScope(scopeId);
1897 }
1898 }
1899
1900 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1902 {
1903 if (stream == null)
1904 {
1905 return XmlReadMode.Auto;
1906 }
1909 return ReadXml(xmlTextReader, denyResolving: false);
1910 }
1911
1912 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1914 {
1915 if (reader == null)
1916 {
1917 return XmlReadMode.Auto;
1918 }
1921 return ReadXml(xmlTextReader, denyResolving: false);
1922 }
1923
1924 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1926 {
1929 try
1930 {
1931 return ReadXml(xmlTextReader, denyResolving: false);
1932 }
1933 finally
1934 {
1935 xmlTextReader.Close();
1936 }
1937 }
1938
1939 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1941 {
1942 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.InferSchema|INFO> {0}, mode={1}", ObjectID, mode);
1943 try
1944 {
1945 if (excludedNamespaces == null)
1946 {
1947 excludedNamespaces = Array.Empty<string>();
1948 }
1954 xmlSchemaSet.Compile();
1957 try
1958 {
1959 xSDSchema.LoadSchema(xmlSchemaSet, this);
1960 }
1961 finally
1962 {
1964 }
1965 }
1966 finally
1967 {
1968 DataCommonEventSource.Log.ExitScope(scopeId);
1969 }
1970 }
1971
1972 private bool IsEmpty()
1973 {
1974 foreach (DataTable table in Tables)
1975 {
1976 if (table.Rows.Count > 0)
1977 {
1978 return false;
1979 }
1980 }
1981 return true;
1982 }
1983
1984 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
1985 private void ReadXmlDiffgram(XmlReader reader)
1986 {
1987 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.ReadXmlDiffgram|INFO> {0}", ObjectID);
1988 try
1989 {
1990 int depth = reader.Depth;
1992 EnforceConstraints = false;
1993 bool flag = IsEmpty();
1995 if (flag)
1996 {
1997 dataSet = this;
1998 }
1999 else
2000 {
2001 dataSet = Clone();
2003 }
2004 foreach (DataTable table in dataSet.Tables)
2005 {
2007 }
2008 reader.MoveToContent();
2009 if (reader.LocalName != "diffgram" && reader.NamespaceURI != "urn:schemas-microsoft-com:xml-diffgram-v1")
2010 {
2011 return;
2012 }
2013 reader.Read();
2014 if (reader.NodeType == XmlNodeType.Whitespace)
2015 {
2016 MoveToElement(reader, reader.Depth - 1);
2017 }
2019 if (reader.Depth > depth)
2020 {
2021 if (reader.NamespaceURI != "urn:schemas-microsoft-com:xml-diffgram-v1" && reader.NamespaceURI != "urn:schemas-microsoft-com:xml-msdata")
2022 {
2024 XmlElement topNode = xmlDocument.CreateElement(reader.Prefix, reader.LocalName, reader.NamespaceURI);
2025 reader.Read();
2026 if (reader.NodeType == XmlNodeType.Whitespace)
2027 {
2028 MoveToElement(reader, reader.Depth - 1);
2029 }
2030 if (reader.Depth - 1 > depth)
2031 {
2034 xmlDataLoader.LoadData(reader);
2035 }
2036 ReadEndElement(reader);
2037 if (reader.NodeType == XmlNodeType.Whitespace)
2038 {
2039 MoveToElement(reader, reader.Depth - 1);
2040 }
2041 }
2042 if ((reader.LocalName == "before" && reader.NamespaceURI == "urn:schemas-microsoft-com:xml-diffgram-v1") || (reader.LocalName == "errors" && reader.NamespaceURI == "urn:schemas-microsoft-com:xml-diffgram-v1"))
2043 {
2045 xMLDiffLoader.LoadDiffGram(dataSet, reader);
2046 }
2047 while (reader.Depth > depth)
2048 {
2049 reader.Read();
2050 }
2051 ReadEndElement(reader);
2052 }
2053 foreach (DataTable table2 in dataSet.Tables)
2054 {
2055 if (table2.Rows._nullInList > 0)
2056 {
2057 throw ExceptionBuilder.RowInsertMissing(table2.TableName);
2058 }
2059 }
2061 foreach (DataTable table3 in dataSet.Tables)
2062 {
2063 DataRelation[] nestedParentRelations = table3.NestedParentRelations;
2065 foreach (DataRelation dataRelation in array)
2066 {
2067 if (dataRelation.ParentTable != table3)
2068 {
2069 continue;
2070 }
2071 foreach (DataRow row in table3.Rows)
2072 {
2074 foreach (DataRelation rel in array2)
2075 {
2076 row.CheckForLoops(rel);
2077 }
2078 }
2079 }
2080 }
2081 if (!flag)
2082 {
2083 Merge(dataSet);
2084 if (_dataSetName == "NewDataSet")
2085 {
2086 _dataSetName = dataSet._dataSetName;
2087 }
2089 }
2091 }
2092 finally
2093 {
2094 DataCommonEventSource.Log.ExitScope(scopeId);
2095 }
2096 }
2097
2098 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2100 {
2101 return ReadXml(reader, mode, denyResolving: false);
2102 }
2103
2104 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2106 {
2107 IDisposable disposable = null;
2108 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.ReadXml|INFO> {0}, mode={1}, denyResolving={2}", ObjectID, mode, denyResolving);
2109 try
2110 {
2112 XmlReadMode result = mode;
2113 if (reader == null)
2114 {
2115 return result;
2116 }
2117 if (mode == XmlReadMode.Auto)
2118 {
2119 return ReadXml(reader);
2120 }
2122 try
2123 {
2124 bool flag = false;
2125 bool flag2 = false;
2126 bool isXdr = false;
2127 int depth = -1;
2128 dSRowDiffIdUsageSection.Prepare(this);
2129 if (reader is XmlTextReader)
2130 {
2131 ((XmlTextReader)reader).WhitespaceHandling = WhitespaceHandling.Significant;
2132 }
2134 if (mode != XmlReadMode.Fragment && reader.NodeType == XmlNodeType.Element)
2135 {
2136 depth = reader.Depth;
2137 }
2138 reader.MoveToContent();
2140 if (reader.NodeType == XmlNodeType.Element)
2141 {
2142 XmlElement xmlElement = null;
2143 if (mode == XmlReadMode.Fragment)
2144 {
2145 xmlDocument.AppendChild(xmlDocument.CreateElement("ds_sqlXmlWraPPeR"));
2146 xmlElement = xmlDocument.DocumentElement;
2147 }
2148 else
2149 {
2150 if (reader.LocalName == "diffgram" && reader.NamespaceURI == "urn:schemas-microsoft-com:xml-diffgram-v1")
2151 {
2152 if (mode == XmlReadMode.DiffGram || mode == XmlReadMode.IgnoreSchema)
2153 {
2154 ReadXmlDiffgram(reader);
2155 ReadEndElement(reader);
2156 }
2157 else
2158 {
2159 reader.Skip();
2160 }
2161 return result;
2162 }
2163 if (reader.LocalName == "Schema" && reader.NamespaceURI == "urn:schemas-microsoft-com:xml-data")
2164 {
2165 if (mode != XmlReadMode.IgnoreSchema && mode != XmlReadMode.InferSchema && mode != XmlReadMode.InferTypedSchema)
2166 {
2167 ReadXDRSchema(reader);
2168 }
2169 else
2170 {
2171 reader.Skip();
2172 }
2173 return result;
2174 }
2175 if (reader.LocalName == "schema" && reader.NamespaceURI == "http://www.w3.org/2001/XMLSchema")
2176 {
2177 if (mode != XmlReadMode.IgnoreSchema && mode != XmlReadMode.InferSchema && mode != XmlReadMode.InferTypedSchema)
2178 {
2180 }
2181 else
2182 {
2183 reader.Skip();
2184 }
2185 return result;
2186 }
2187 if (reader.LocalName == "schema" && reader.NamespaceURI.StartsWith("http://www.w3.org/", StringComparison.Ordinal))
2188 {
2189 throw ExceptionBuilder.DataSetUnsupportedSchema("http://www.w3.org/2001/XMLSchema");
2190 }
2191 xmlElement = xmlDocument.CreateElement(reader.Prefix, reader.LocalName, reader.NamespaceURI);
2192 if (reader.HasAttributes)
2193 {
2194 int attributeCount = reader.AttributeCount;
2195 for (int i = 0; i < attributeCount; i++)
2196 {
2197 reader.MoveToAttribute(i);
2198 if (reader.NamespaceURI.Equals("http://www.w3.org/2000/xmlns/"))
2199 {
2200 xmlElement.SetAttribute(reader.Name, reader.GetAttribute(i));
2201 continue;
2202 }
2203 XmlAttribute xmlAttribute = xmlElement.SetAttributeNode(reader.LocalName, reader.NamespaceURI);
2204 xmlAttribute.Prefix = reader.Prefix;
2205 xmlAttribute.Value = reader.GetAttribute(i);
2206 }
2207 }
2208 reader.Read();
2209 }
2210 while (MoveToElement(reader, depth))
2211 {
2212 if (reader.LocalName == "Schema" && reader.NamespaceURI == "urn:schemas-microsoft-com:xml-data")
2213 {
2214 if (!flag && !flag2 && mode != XmlReadMode.IgnoreSchema && mode != XmlReadMode.InferSchema && mode != XmlReadMode.InferTypedSchema)
2215 {
2216 ReadXDRSchema(reader);
2217 flag = true;
2218 isXdr = true;
2219 }
2220 else
2221 {
2222 reader.Skip();
2223 }
2224 continue;
2225 }
2226 if (reader.LocalName == "schema" && reader.NamespaceURI == "http://www.w3.org/2001/XMLSchema")
2227 {
2228 if (mode != XmlReadMode.IgnoreSchema && mode != XmlReadMode.InferSchema && mode != XmlReadMode.InferTypedSchema)
2229 {
2231 flag = true;
2232 }
2233 else
2234 {
2235 reader.Skip();
2236 }
2237 continue;
2238 }
2239 if (reader.LocalName == "diffgram" && reader.NamespaceURI == "urn:schemas-microsoft-com:xml-diffgram-v1")
2240 {
2241 if (mode == XmlReadMode.DiffGram || mode == XmlReadMode.IgnoreSchema)
2242 {
2243 ReadXmlDiffgram(reader);
2244 result = XmlReadMode.DiffGram;
2245 }
2246 else
2247 {
2248 reader.Skip();
2249 }
2250 continue;
2251 }
2252 if (reader.LocalName == "schema" && reader.NamespaceURI.StartsWith("http://www.w3.org/", StringComparison.Ordinal))
2253 {
2254 throw ExceptionBuilder.DataSetUnsupportedSchema("http://www.w3.org/2001/XMLSchema");
2255 }
2256 if (mode == XmlReadMode.DiffGram)
2257 {
2258 reader.Skip();
2259 continue;
2260 }
2261 flag2 = true;
2262 if (mode == XmlReadMode.InferSchema || mode == XmlReadMode.InferTypedSchema)
2263 {
2264 XmlNode newChild = xmlDocument.ReadNode(reader);
2265 xmlElement.AppendChild(newChild);
2266 continue;
2267 }
2268 if (xmlDataLoader == null)
2269 {
2270 xmlDataLoader = new XmlDataLoader(this, isXdr, xmlElement, mode == XmlReadMode.IgnoreSchema);
2271 }
2272 xmlDataLoader.LoadData(reader);
2273 }
2274 ReadEndElement(reader);
2275 xmlDocument.AppendChild(xmlElement);
2276 if (xmlDataLoader == null)
2277 {
2278 xmlDataLoader = new XmlDataLoader(this, isXdr, mode == XmlReadMode.IgnoreSchema);
2279 }
2280 switch (mode)
2281 {
2282 case XmlReadMode.DiffGram:
2283 return result;
2284 case XmlReadMode.InferSchema:
2285 case XmlReadMode.InferTypedSchema:
2286 InferSchema(xmlDocument, null, mode);
2287 result = XmlReadMode.InferSchema;
2289 try
2290 {
2291 xmlDataLoader.LoadData(xmlDocument);
2292 }
2293 finally
2294 {
2296 }
2297 break;
2298 }
2299 }
2300 return result;
2301 }
2302 finally
2303 {
2304 }
2305 }
2306 finally
2307 {
2308 disposable?.Dispose();
2309 DataCommonEventSource.Log.ExitScope(scopeId);
2310 }
2311 }
2312
2313 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2315 {
2316 if (stream == null)
2317 {
2318 return XmlReadMode.Auto;
2319 }
2320 XmlTextReader xmlTextReader = ((mode == XmlReadMode.Fragment) ? new XmlTextReader(stream, XmlNodeType.Element, null) : new XmlTextReader(stream));
2322 return ReadXml(xmlTextReader, mode, denyResolving: false);
2323 }
2324
2325 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2327 {
2328 if (reader == null)
2329 {
2330 return XmlReadMode.Auto;
2331 }
2332 XmlTextReader xmlTextReader = ((mode == XmlReadMode.Fragment) ? new XmlTextReader(reader.ReadToEnd(), XmlNodeType.Element, null) : new XmlTextReader(reader));
2334 return ReadXml(xmlTextReader, mode, denyResolving: false);
2335 }
2336
2337 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2339 {
2341 if (mode == XmlReadMode.Fragment)
2342 {
2344 xmlTextReader = new XmlTextReader(xmlFragment, XmlNodeType.Element, null);
2345 }
2346 else
2347 {
2349 }
2351 try
2352 {
2353 return ReadXml(xmlTextReader, mode, denyResolving: false);
2354 }
2355 finally
2356 {
2357 xmlTextReader.Close();
2358 }
2359 }
2360
2361 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2362 public void WriteXml(Stream? stream)
2363 {
2364 WriteXml(stream, XmlWriteMode.IgnoreSchema);
2365 }
2366
2367 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2369 {
2370 WriteXml(writer, XmlWriteMode.IgnoreSchema);
2371 }
2372
2373 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2375 {
2376 WriteXml(writer, XmlWriteMode.IgnoreSchema);
2377 }
2378
2379 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2380 public void WriteXml(string fileName)
2381 {
2382 WriteXml(fileName, XmlWriteMode.IgnoreSchema);
2383 }
2384
2385 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2387 {
2388 if (stream != null)
2389 {
2392 WriteXml(xmlTextWriter, mode);
2393 }
2394 }
2395
2396 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2398 {
2399 if (writer != null)
2400 {
2403 WriteXml(xmlTextWriter, mode);
2404 }
2405 }
2406
2407 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2409 {
2410 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.WriteXml|API> {0}, mode={1}", ObjectID, mode);
2411 try
2412 {
2413 if (writer != null)
2414 {
2415 if (mode == XmlWriteMode.DiffGram)
2416 {
2417 new NewDiffgramGen(this).Save(writer);
2418 }
2419 else
2420 {
2421 new XmlDataTreeWriter(this).Save(writer, mode == XmlWriteMode.WriteSchema);
2422 }
2423 }
2424 }
2425 finally
2426 {
2427 DataCommonEventSource.Log.ExitScope(scopeId);
2428 }
2429 }
2430
2431 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2432 public void WriteXml(string fileName, XmlWriteMode mode)
2433 {
2434 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.WriteXml|API> {0}, fileName='{1}', mode={2}", ObjectID, fileName, (int)mode);
2436 try
2437 {
2439 xmlTextWriter.WriteStartDocument(standalone: true);
2440 if (mode == XmlWriteMode.DiffGram)
2441 {
2443 }
2444 else
2445 {
2446 new XmlDataTreeWriter(this).Save(xmlTextWriter, mode == XmlWriteMode.WriteSchema);
2447 }
2448 xmlTextWriter.WriteEndDocument();
2449 }
2450 finally
2451 {
2452 xmlTextWriter.Close();
2453 DataCommonEventSource.Log.ExitScope(scopeId);
2454 }
2455 }
2456
2457 public void Merge(DataSet dataSet)
2458 {
2459 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.Merge|API> {0}, dataSet={1}", ObjectID, dataSet?.ObjectID ?? 0);
2460 try
2461 {
2463 }
2464 finally
2465 {
2466 DataCommonEventSource.Log.ExitScope(scopeId);
2467 }
2468 }
2469
2471 {
2472 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.Merge|API> {0}, dataSet={1}, preserveChanges={2}", ObjectID, dataSet?.ObjectID ?? 0, preserveChanges);
2473 try
2474 {
2476 }
2477 finally
2478 {
2479 DataCommonEventSource.Log.ExitScope(scopeId);
2480 }
2481 }
2482
2484 {
2485 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.Merge|API> {0}, dataSet={1}, preserveChanges={2}, missingSchemaAction={3}", ObjectID, dataSet?.ObjectID ?? 0, preserveChanges, missingSchemaAction);
2486 try
2487 {
2488 if (dataSet == null)
2489 {
2490 throw ExceptionBuilder.ArgumentNull("dataSet");
2491 }
2492 if ((uint)(missingSchemaAction - 1) <= 3u)
2493 {
2495 merger.MergeDataSet(dataSet);
2496 return;
2497 }
2499 }
2500 finally
2501 {
2502 DataCommonEventSource.Log.ExitScope(scopeId);
2503 }
2504 }
2505
2506 public void Merge(DataTable table)
2507 {
2508 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.Merge|API> {0}, table={1}", ObjectID, table?.ObjectID ?? 0);
2509 try
2510 {
2511 Merge(table, preserveChanges: false, MissingSchemaAction.Add);
2512 }
2513 finally
2514 {
2515 DataCommonEventSource.Log.ExitScope(scopeId);
2516 }
2517 }
2518
2520 {
2521 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.Merge|API> {0}, table={1}, preserveChanges={2}, missingSchemaAction={3}", ObjectID, table?.ObjectID ?? 0, preserveChanges, missingSchemaAction);
2522 try
2523 {
2524 if (table == null)
2525 {
2526 throw ExceptionBuilder.ArgumentNull("table");
2527 }
2528 if ((uint)(missingSchemaAction - 1) <= 3u)
2529 {
2531 merger.MergeTable(table);
2532 return;
2533 }
2535 }
2536 finally
2537 {
2538 DataCommonEventSource.Log.ExitScope(scopeId);
2539 }
2540 }
2541
2542 public void Merge(DataRow[] rows)
2543 {
2544 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.Merge|API> {0}, rows", ObjectID);
2545 try
2546 {
2548 }
2549 finally
2550 {
2551 DataCommonEventSource.Log.ExitScope(scopeId);
2552 }
2553 }
2554
2556 {
2557 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.Merge|API> {0}, preserveChanges={1}, missingSchemaAction={2}", ObjectID, preserveChanges, missingSchemaAction);
2558 try
2559 {
2560 if (rows == null)
2561 {
2562 throw ExceptionBuilder.ArgumentNull("rows");
2563 }
2564 if ((uint)(missingSchemaAction - 1) <= 3u)
2565 {
2567 merger.MergeRows(rows);
2568 return;
2569 }
2571 }
2572 finally
2573 {
2574 DataCommonEventSource.Log.ExitScope(scopeId);
2575 }
2576 }
2577
2579 {
2580 this.PropertyChanging?.Invoke(this, pcevent);
2581 }
2582
2584 {
2585 if (this.MergeFailed != null)
2586 {
2587 this.MergeFailed(this, mfevent);
2588 return;
2589 }
2590 throw ExceptionBuilder.MergeFailed(mfevent.Conflict);
2591 }
2592
2601
2603 {
2604 this.DataRowCreated?.Invoke(this, row);
2605 }
2606
2608 {
2609 this.ClearFunctionCalled?.Invoke(this, table);
2610 }
2611
2612 private void OnInitialized()
2613 {
2614 this.Initialized?.Invoke(this, EventArgs.Empty);
2615 }
2616
2617 protected internal virtual void OnRemoveTable(DataTable table)
2618 {
2619 }
2620
2621 internal void OnRemovedTable(DataTable table)
2622 {
2624 }
2625
2627 {
2628 }
2629
2634
2635 protected internal void RaisePropertyChanging(string name)
2636 {
2638 }
2639
2641 {
2642 return TopLevelTables(forSchema: false);
2643 }
2644
2646 {
2648 if (forSchema)
2649 {
2650 for (int i = 0; i < Tables.Count; i++)
2651 {
2653 if (dataTable.NestedParentsCount > 1 || dataTable.SelfNested)
2654 {
2656 }
2657 }
2658 }
2659 for (int j = 0; j < Tables.Count; j++)
2660 {
2662 if (dataTable2.NestedParentsCount == 0 && !list.Contains(dataTable2))
2663 {
2665 }
2666 }
2667 if (list.Count != 0)
2668 {
2669 return list.ToArray();
2670 }
2671 return Array.Empty<DataTable>();
2672 }
2673
2674 public virtual void RejectChanges()
2675 {
2676 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.RejectChanges|API> {0}", ObjectID);
2677 try
2678 {
2680 EnforceConstraints = false;
2681 for (int i = 0; i < Tables.Count; i++)
2682 {
2683 Tables[i].RejectChanges();
2684 }
2686 }
2687 finally
2688 {
2689 DataCommonEventSource.Log.ExitScope(scopeId);
2690 }
2691 }
2692
2693 public virtual void Reset()
2694 {
2695 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.Reset|API> {0}", ObjectID);
2696 try
2697 {
2698 for (int i = 0; i < Tables.Count; i++)
2699 {
2700 ConstraintCollection constraints = Tables[i].Constraints;
2701 int num = 0;
2702 while (num < constraints.Count)
2703 {
2705 {
2707 }
2708 else
2709 {
2710 num++;
2711 }
2712 }
2713 }
2714 Clear();
2715 Relations.Clear();
2716 Tables.Clear();
2717 }
2718 finally
2719 {
2720 DataCommonEventSource.Log.ExitScope(scopeId);
2721 }
2722 }
2723
2725 {
2726 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.ValidateCaseConstraint|INFO> {0}", ObjectID);
2727 try
2728 {
2730 for (int i = 0; i < Relations.Count; i++)
2731 {
2733 if (dataRelation.ChildTable.CaseSensitive != dataRelation.ParentTable.CaseSensitive)
2734 {
2735 return false;
2736 }
2737 }
2740 for (int j = 0; j < Tables.Count; j++)
2741 {
2742 constraintCollection = Tables[j].Constraints;
2743 for (int k = 0; k < constraintCollection.Count; k++)
2744 {
2746 {
2748 if (foreignKeyConstraint.Table.CaseSensitive != foreignKeyConstraint.RelatedTable.CaseSensitive)
2749 {
2750 return false;
2751 }
2752 }
2753 }
2754 }
2755 return true;
2756 }
2757 finally
2758 {
2759 DataCommonEventSource.Log.ExitScope(scopeId);
2760 }
2761 }
2762
2764 {
2765 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.ValidateLocaleConstraint|INFO> {0}", ObjectID);
2766 try
2767 {
2769 for (int i = 0; i < Relations.Count; i++)
2770 {
2772 if (dataRelation.ChildTable.Locale.LCID != dataRelation.ParentTable.Locale.LCID)
2773 {
2774 return false;
2775 }
2776 }
2779 for (int j = 0; j < Tables.Count; j++)
2780 {
2781 constraintCollection = Tables[j].Constraints;
2782 for (int k = 0; k < constraintCollection.Count; k++)
2783 {
2785 {
2787 if (foreignKeyConstraint.Table.Locale.LCID != foreignKeyConstraint.RelatedTable.Locale.LCID)
2788 {
2789 return false;
2790 }
2791 }
2792 }
2793 }
2794 return true;
2795 }
2796 finally
2797 {
2798 DataCommonEventSource.Log.ExitScope(scopeId);
2799 }
2800 }
2801
2803 {
2804 if (props.Length < propStart + 1)
2805 {
2806 return baseTable;
2807 }
2809 if (baseTable == null)
2810 {
2812 {
2814 }
2815 return null;
2816 }
2818 {
2819 return FindTable(((DataRelationPropertyDescriptor)propertyDescriptor).Relation.ChildTable, props, propStart + 1);
2820 }
2821 return null;
2822 }
2823
2824 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
2825 protected virtual void ReadXmlSerializable(XmlReader reader)
2826 {
2827 _useDataSetSchemaOnly = false;
2828 _udtIsWrapped = false;
2829 if (reader.HasAttributes)
2830 {
2831 if (reader.MoveToAttribute("xsi:nil"))
2832 {
2833 string attribute = reader.GetAttribute("xsi:nil");
2834 if (string.Equals(attribute, "true", StringComparison.Ordinal))
2835 {
2836 MoveToElement(reader, 1);
2837 return;
2838 }
2839 }
2840 if (reader.MoveToAttribute("msdata:UseDataSetSchemaOnly"))
2841 {
2842 string attribute2 = reader.GetAttribute("msdata:UseDataSetSchemaOnly");
2843 if (string.Equals(attribute2, "true", StringComparison.Ordinal) || string.Equals(attribute2, "1", StringComparison.Ordinal))
2844 {
2845 _useDataSetSchemaOnly = true;
2846 }
2847 else if (!string.Equals(attribute2, "false", StringComparison.Ordinal) && !string.Equals(attribute2, "0", StringComparison.Ordinal))
2848 {
2849 throw ExceptionBuilder.InvalidAttributeValue("UseDataSetSchemaOnly", attribute2);
2850 }
2851 }
2852 if (reader.MoveToAttribute("msdata:UDTColumnValueWrapped"))
2853 {
2854 string attribute3 = reader.GetAttribute("msdata:UDTColumnValueWrapped");
2855 if (string.Equals(attribute3, "true", StringComparison.Ordinal) || string.Equals(attribute3, "1", StringComparison.Ordinal))
2856 {
2857 _udtIsWrapped = true;
2858 }
2859 else if (!string.Equals(attribute3, "false", StringComparison.Ordinal) && !string.Equals(attribute3, "0", StringComparison.Ordinal))
2860 {
2861 throw ExceptionBuilder.InvalidAttributeValue("UDTColumnValueWrapped", attribute3);
2862 }
2863 }
2864 }
2865 ReadXml(reader, XmlReadMode.DiffGram, denyResolving: true);
2866 }
2867
2869 {
2870 return null;
2871 }
2872
2895
2897 {
2898 if (GetType() == typeof(DataSet))
2899 {
2900 return null;
2901 }
2904 if (xmlWriter != null)
2905 {
2907 }
2909 return XmlSchema.Read(new XmlTextReader(memoryStream), null);
2910 }
2911
2912 [RequiresUnreferencedCode("DataSet.GetSchema uses TypeDescriptor and XmlSerialization underneath which are not trimming safe. Members from serialized types may be trimmed if not referenced directly.")]
2914 {
2915 new XmlTreeGen(SchemaFormat.WebService).Save(ds, writer);
2916 }
2917
2919 {
2920 bool flag = true;
2923 if (xmlTextParser != null)
2924 {
2925 flag = xmlTextParser.Normalized;
2927 }
2928 else
2929 {
2931 if (xmlTextReader != null)
2932 {
2933 flag = xmlTextReader.Normalization;
2935 }
2936 }
2938 if (xmlTextParser != null)
2939 {
2941 }
2942 else if (xmlTextReader != null)
2943 {
2945 }
2946 }
2947
2948 [RequiresUnreferencedCode("DataSet.ReadXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may be trimmed if not referenced directly.")]
2950 {
2951 ReadXmlSerializable(reader);
2952 }
2953
2958
2959 [RequiresUnreferencedCode("DataSet.WriteXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may be trimmed if not referenced directly.")]
2961 {
2962 WriteXmlSchema(writer, SchemaFormat.WebService, null);
2963 WriteXml(writer, XmlWriteMode.DiffGram);
2964 }
2965
2966 [RequiresUnreferencedCode("Using LoadOption may cause members from types used in the expression column to be trimmed if not referenced directly.")]
2968 {
2969 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.Load|API> reader, loadOption={0}", loadOption);
2970 try
2971 {
2972 foreach (DataTable dataTable in tables)
2973 {
2974 ADP.CheckArgumentNull(dataTable, "tables");
2975 if (dataTable.DataSet != this)
2976 {
2978 }
2979 }
2983 if (errorHandler != null)
2984 {
2986 }
2987 loadAdapter.FillFromReader(tables, reader, 0, 0);
2988 if (!reader.IsClosed && !reader.NextResult())
2989 {
2990 reader.Close();
2991 }
2992 }
2993 finally
2994 {
2995 DataCommonEventSource.Log.ExitScope(scopeId);
2996 }
2997 }
2998
2999 [RequiresUnreferencedCode("Using LoadOption may cause members from types used in the expression column to be trimmed if not referenced directly.")]
3001 {
3002 Load(reader, loadOption, null, tables);
3003 }
3004
3005 [RequiresUnreferencedCode("Using LoadOption may cause members from types used in the expression column to be trimmed if not referenced directly.")]
3006 public void Load(IDataReader reader, LoadOption loadOption, params string[] tables)
3007 {
3008 ADP.CheckArgumentNull(tables, "tables");
3009 DataTable[] array = new DataTable[tables.Length];
3010 for (int i = 0; i < tables.Length; i++)
3011 {
3013 if (dataTable == null)
3014 {
3015 dataTable = new DataTable(tables[i]);
3017 }
3018 array[i] = dataTable;
3019 }
3020 Load(reader, loadOption, null, array);
3021 }
3022
3024 {
3025 if (Tables.Count == 0)
3026 {
3028 }
3030 for (int i = 0; i < Tables.Count; i++)
3031 {
3032 array[i] = Tables[i];
3033 }
3034 return CreateDataReader(array);
3035 }
3036
3038 {
3039 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.GetDataReader|API> {0}", ObjectID);
3040 try
3041 {
3042 if (dataTables.Length == 0)
3043 {
3045 }
3046 for (int i = 0; i < dataTables.Length; i++)
3047 {
3048 if (dataTables[i] == null)
3049 {
3051 }
3052 }
3053 return new DataTableReader(dataTables);
3054 }
3055 finally
3056 {
3057 DataCommonEventSource.Log.ExitScope(scopeId);
3058 }
3059 }
3060}
static ? object CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors|DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type, BindingFlags bindingAttr, Binder? binder, object?[]? args, CultureInfo? culture)
Definition Activator.cs:17
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
virtual ICollection Keys
Definition Hashtable.cs:532
static ArgumentOutOfRangeException InvalidMissingSchemaAction(MissingSchemaAction value)
Definition ADP.cs:134
static void CheckArgumentNull([NotNull] object value, string parameterName)
Definition ADP.cs:782
static bool IsCatchableExceptionType(Exception e)
Definition ADP.cs:790
static void TraceExceptionWithoutRethrow(Exception e)
Definition ADP.cs:673
static readonly DataCommonEventSource Log
virtual DataTable ChildTable
XmlReadMode ReadXml(XmlReader? reader)
Definition DataSet.cs:1685
string _mainTableName
Definition DataSet.cs:91
void DeserializeDataSetProperties(SerializationInfo info, StreamingContext context)
Definition DataSet.cs:707
void DeserializeRelations(SerializationInfo info, StreamingContext context)
Definition DataSet.cs:748
void WriteXmlSchema(XmlWriter? writer, Converter< Type, string > multipleTargetConverter)
Definition DataSet.cs:1620
static void MoveToElement(XmlReader reader)
Definition DataSet.cs:1475
void OnDataRowCreated(DataRow row)
Definition DataSet.cs:2602
void SerializeDataSetProperties(SerializationInfo info, StreamingContext context)
Definition DataSet.cs:696
DataSetClearEventhandler? ClearFunctionCalled
Definition DataSet.cs:430
void InferXmlSchema(TextReader? reader, string[]? nsArray)
Definition DataSet.cs:1352
void WriteXmlSchema(string fileName, SchemaFormat schemaFormat, Converter< Type, string > multipleTargetConverter)
Definition DataSet.cs:1627
void WriteXmlSchema(Stream stream, SchemaFormat schemaFormat, Converter< Type, string > multipleTargetConverter)
Definition DataSet.cs:1644
void Merge(DataRow[] rows, bool preserveChanges, MissingSchemaAction missingSchemaAction)
Definition DataSet.cs:2555
void WriteXmlSchema(TextWriter writer, SchemaFormat schemaFormat, Converter< Type, string > multipleTargetConverter)
Definition DataSet.cs:1655
bool ShouldSerializeLocale()
Definition DataSet.cs:899
virtual SchemaSerializationMode SchemaSerializationMode
Definition DataSet.cs:131
virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Definition DataSet.cs:559
XmlReadMode ReadXml(string fileName, XmlReadMode mode)
Definition DataSet.cs:2338
void WriteXml(Stream? stream, XmlWriteMode mode)
Definition DataSet.cs:2386
override? ISite Site
Definition DataSet.cs:366
bool _useDataSetSchemaOnly
Definition DataSet.cs:103
void OnMergeFailed(MergeFailedEventArgs mfevent)
Definition DataSet.cs:2583
DataRelationCollection Relations
Definition DataSet.cs:393
void ReadXmlSchema(Stream? stream)
Definition DataSet.cs:1543
virtual bool ShouldSerializeRelations()
Definition DataSet.cs:904
void WriteXmlSchema(Stream? stream)
Definition DataSet.cs:1575
CultureInfo _culture
Definition DataSet.cs:73
static void WriteXmlSchema(DataSet ds, XmlWriter writer)
Definition DataSet.cs:2913
void ReadXmlSchema(TextReader? reader)
Definition DataSet.cs:1552
XmlReadMode ReadXml(XmlReader? reader, XmlReadMode mode)
Definition DataSet.cs:2099
virtual void Load(IDataReader reader, LoadOption loadOption, FillErrorEventHandler? errorHandler, params DataTable[] tables)
Definition DataSet.cs:2967
DataSet(SerializationInfo info, StreamingContext context)
Definition DataSet.cs:520
DataTableCollection Tables
Definition DataSet.cs:396
PropertyChangedEventHandler? PropertyChanging
Definition DataSet.cs:424
SchemaSerializationMode DetermineSchemaSerializationMode(XmlReader reader)
Definition DataSet.cs:479
string _namespaceURI
Definition DataSet.cs:67
DataSet(string dataSetName)
Definition DataSet.cs:443
string GetXmlSchemaForRemoting(DataTable table)
Definition DataSet.cs:1255
void RestoreEnforceConstraints(bool value)
Definition DataSet.cs:783
virtual bool ShouldSerializeTables()
Definition DataSet.cs:909
XmlReadMode ReadXml(XmlReader reader, bool denyResolving)
Definition DataSet.cs:1691
virtual void InitializeDerivedDataSet()
Definition DataSet.cs:565
SchemaSerializationMode DetermineSchemaSerializationMode(SerializationInfo info, StreamingContext context)
Definition DataSet.cs:464
void ReadXmlSchema(string fileName)
Definition DataSet.cs:1561
void WriteXml(XmlWriter? writer, XmlWriteMode mode)
Definition DataSet.cs:2408
DataTable FindTable(DataTable baseTable, PropertyDescriptor[] props, int propStart)
Definition DataSet.cs:2802
DataSet(SerializationInfo info, StreamingContext context, bool ConstructSchema)
Definition DataSet.cs:527
SerializationFormat RemotingFormat
Definition DataSet.cs:109
void InferSchema(XmlDocument xdoc, string[] excludedNamespaces, XmlReadMode mode)
Definition DataSet.cs:1940
bool IsBinarySerialized(SerializationInfo info, StreamingContext context)
Definition DataSet.cs:449
void ReadXmlSchema(XmlReader? reader)
Definition DataSet.cs:1375
string _dataSetName
Definition DataSet.cs:63
DataTable[] TopLevelTables()
Definition DataSet.cs:2640
void Merge(DataSet dataSet, bool preserveChanges, MissingSchemaAction missingSchemaAction)
Definition DataSet.cs:2483
bool ValidateLocaleConstraint()
Definition DataSet.cs:2763
void Load(IDataReader reader, LoadOption loadOption, params DataTable[] tables)
Definition DataSet.cs:3000
virtual ? XmlSchema GetSchemaSerializable()
Definition DataSet.cs:2868
bool _enforceConstraints
Definition DataSet.cs:69
void InferXmlSchema(string fileName, string[]? nsArray)
Definition DataSet.cs:1361
XmlReadMode ReadXml(TextReader? reader)
Definition DataSet.cs:1913
static XmlSchemaComplexType s_schemaTypeForWSDL
Definition DataSet.cs:101
readonly DataRelationCollection _relationCollection
Definition DataSet.cs:59
void WriteXmlSchema(Stream? stream, Converter< Type, string > multipleTargetConverter)
Definition DataSet.cs:1581
void EnableConstraints()
Definition DataSet.cs:788
void DeserializeDataSet(SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat, SchemaSerializationMode schemaSerializationMode)
Definition DataSet.cs:629
XmlReadMode ReadXml(string fileName)
Definition DataSet.cs:1925
virtual DataSet Clone()
Definition DataSet.cs:977
void MarkRelatedRowsAsModified(TableChanges[] bitMatrix, DataRow row)
Definition DataSet.cs:1179
virtual void Reset()
Definition DataSet.cs:2693
void ReadXmlSchema(XmlReader reader, bool denyResolving)
Definition DataSet.cs:1381
void InferXmlSchema(XmlReader? reader, string[]? nsArray)
Definition DataSet.cs:1313
XmlReadMode ReadXml(XmlReader reader, XmlReadMode mode, bool denyResolving)
Definition DataSet.cs:2105
void WriteXmlSchema(string fileName)
Definition DataSet.cs:1588
void WriteXml(Stream? stream)
Definition DataSet.cs:2362
DataViewManager _defaultViewManager
Definition DataSet.cs:55
XmlReadMode ReadXml(TextReader? reader, XmlReadMode mode)
Definition DataSet.cs:2326
static int s_objectTypeCount
Definition DataSet.cs:97
void WriteXmlSchema(TextWriter? writer, Converter< Type, string > multipleTargetConverter)
Definition DataSet.cs:1607
void WriteXmlSchema(XmlWriter writer, SchemaFormat schemaFormat, Converter< Type, string > multipleTargetConverter)
Definition DataSet.cs:1666
void WriteXml(TextWriter? writer)
Definition DataSet.cs:2368
DataSet? GetChanges()
Definition DataSet.cs:1098
string GetXmlSchema()
Definition DataSet.cs:1237
DataTableReader CreateDataReader(params DataTable[] dataTables)
Definition DataSet.cs:3037
CultureInfo Locale
Definition DataSet.cs:337
PropertyCollection ExtendedProperties
Definition DataSet.cs:315
virtual void OnRemoveRelation(DataRelation relation)
Definition DataSet.cs:2626
bool ValidateCaseConstraint()
Definition DataSet.cs:2724
void ReadXDRSchema(XmlReader reader)
Definition DataSet.cs:1532
XmlReadMode ReadXml(Stream? stream, XmlReadMode mode)
Definition DataSet.cs:2314
DataSet? GetChanges(DataRowState rowStates)
Definition DataSet.cs:1103
void Merge(DataTable table)
Definition DataSet.cs:2506
EventHandler? Initialized
Definition DataSet.cs:432
void WriteXml(XmlWriter? writer)
Definition DataSet.cs:2374
void Merge(DataRow[] rows)
Definition DataSet.cs:2542
SerializationFormat _remotingFormat
Definition DataSet.cs:93
void ReadXmlDiffgram(XmlReader reader)
Definition DataSet.cs:1985
void WriteXmlSchema(XmlWriter? writer)
Definition DataSet.cs:1614
DataRowCreatedEventHandler? DataRowCreated
Definition DataSet.cs:428
virtual void OnPropertyChanging(PropertyChangedEventArgs pcevent)
Definition DataSet.cs:2578
void OnClearFunctionCalled(DataTable table)
Definition DataSet.cs:2607
string _datasetPrefix
Definition DataSet.cs:65
void WriteXml(string fileName)
Definition DataSet.cs:2380
int EstimatedXmlStringSize()
Definition DataSet.cs:1081
void ReadXmlSerializableInternal(XmlReader reader)
Definition DataSet.cs:2949
void Merge(DataSet dataSet)
Definition DataSet.cs:2457
void DeserializeDataSetData(SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat)
Definition DataSet.cs:679
void SerializeDataSet(SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat)
Definition DataSet.cs:570
void WriteXml(string fileName, XmlWriteMode mode)
Definition DataSet.cs:2432
readonly DataTableCollection _tableCollection
Definition DataSet.cs:57
readonly int _objectID
Definition DataSet.cs:99
void InferXmlSchema(Stream? stream, string[]? nsArray)
Definition DataSet.cs:1343
void Merge(DataTable table, bool preserveChanges, MissingSchemaAction missingSchemaAction)
Definition DataSet.cs:2519
void ReadXSDSchema(XmlReader reader, bool denyResolving)
Definition DataSet.cs:1500
void ReadEndElement(XmlReader reader)
Definition DataSet.cs:1483
virtual void OnRemoveTable(DataTable table)
Definition DataSet.cs:2617
void WriteXmlSchema(TextWriter? writer)
Definition DataSet.cs:1601
bool MoveToElement(XmlReader reader, int depth)
Definition DataSet.cs:1466
void FailedEnableConstraints()
Definition DataSet.cs:777
void SerializeRelations(SerializationInfo info, StreamingContext context)
Definition DataSet.cs:720
bool HasChanges(DataRowState rowStates)
Definition DataSet.cs:1283
void Load(IDataReader reader, LoadOption loadOption, params string[] tables)
Definition DataSet.cs:3006
virtual void RejectChanges()
Definition DataSet.cs:2674
DataTableReader CreateDataReader()
Definition DataSet.cs:3023
MergeFailedEventHandler? MergeFailed
Definition DataSet.cs:426
void WriteXmlSchema(string fileName, Converter< Type, string > multipleTargetConverter)
Definition DataSet.cs:1594
PropertyCollection _extendedProperties
Definition DataSet.cs:61
void SetLocaleValue(CultureInfo value, bool userSet)
Definition DataSet.cs:825
readonly object _defaultViewManagerLock
Definition DataSet.cs:95
DataTable[] TopLevelTables(bool forSchema)
Definition DataSet.cs:2645
virtual void ReadXmlSerializable(XmlReader reader)
Definition DataSet.cs:2825
void OnRemovedTable(DataTable table)
Definition DataSet.cs:2621
void WriteXml(TextWriter? writer, XmlWriteMode mode)
Definition DataSet.cs:2397
string GetRemotingDiffGram(DataTable table)
Definition DataSet.cs:1209
void MarkModifiedRows(TableChanges[] bitMatrix, DataRowState rowStates)
Definition DataSet.cs:1157
void RaiseMergeFailed(DataTable table, string conflict, MissingSchemaAction missingSchemaAction)
Definition DataSet.cs:2593
void GetSerializationData(SerializationInfo info, StreamingContext context)
Definition DataSet.cs:503
void RaisePropertyChanging(string name)
Definition DataSet.cs:2635
void WriteXmlInternal(XmlWriter writer)
Definition DataSet.cs:2960
DataSet CreateInstanceOfThisType()
Definition DataSet.cs:971
void Merge(DataSet dataSet, bool preserveChanges)
Definition DataSet.cs:2470
static XmlSchemaComplexType GetDataSetSchema(XmlSchemaSet? schemaSet)
Definition DataSet.cs:2873
XmlReadMode ReadXml(Stream? stream)
Definition DataSet.cs:1901
DataViewManager DefaultViewManager
Definition DataSet.cs:176
void DeserializeDataSetSchema(SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat, SchemaSerializationMode schemaSerializationMode)
Definition DataSet.cs:636
void OnRemoveRelationHack(DataRelation relation)
Definition DataSet.cs:2630
bool SetCaseSensitiveValue(bool isCaseSensitive, bool userSet, bool resetIndexes)
DataRowCollection Rows
Definition DataTable.cs:701
DataColumnCollection Columns
Definition DataTable.cs:327
void CheckCascadingNamespaceConflict(string realNamespace)
bool SetLocaleValue(CultureInfo culture, bool userSet, bool resetIndexes)
DataRelation[] NestedParentRelations
Definition DataTable.cs:586
DataViewSettingCollection DataViewSettings
static Exception RowInsertMissing(string tableName)
static Exception SetDataSetNameConflicting(string name)
static Exception DataTableReaderArgumentIsEmpty()
static Exception EnforceConstraint()
static Exception MergeFailed(string name)
static Exception ArgumentContainsNullValue()
static Exception InvalidAttributeValue(string name, string value)
static Exception InvalidRowState(DataRowState state)
static Exception DuplicateTableName2(string table, string ns)
static Exception ArgumentOutOfRange(string paramName)
static Exception CannotChangeCaseLocale()
static Exception CannotChangeSchemaSerializationMode()
static Exception SetDataSetNameToEmpty()
static Exception InvalidPrefix(string name)
static Exception CannotCreateDataReaderOnEmptyDataSet()
static Exception TableNotInTheDataSet(string table)
static Exception InvalidSchemaSerializationMode(Type enumType, string mode)
static Exception DataSetUnsupportedSchema(string ns)
static Exception InvalidRemotingFormat(SerializationFormat mode)
static Exception ArgumentNull(string paramName)
void Save(XmlWriter xmlw)
static IDisposable EnterRestrictedScope(DataSet dataSet)
void Save(XmlWriter xw, bool writeSchema)
void Save(DataSet ds, XmlWriter xw)
static readonly EventArgs Empty
Definition EventArgs.cs:9
static void SuppressFinalize(object obj)
Definition GC.cs:202
Definition GC.cs:8
static CultureInfo CurrentCulture
static CultureInfo InvariantCulture
override bool Equals([NotNullWhen(true)] object? value)
virtual string ReadToEnd()
static int Increment(ref int location)
static ? XmlSchema Read(TextReader reader, ValidationEventHandler? validationEventHandler)
Definition XmlSchema.cs:432
static ? string EncodeName(string? name)
Definition XmlConvert.cs:37
static ? string DecodeName(string? name)
Definition XmlConvert.cs:55
string? GetAttribute(string name)
virtual void Skip()
Definition XmlReader.cs:532
virtual void ReadEndElement()
Definition XmlReader.cs:751
bool MoveToAttribute(string name)
virtual bool HasAttributes
Definition XmlReader.cs:124
virtual XmlNodeType MoveToContent()
Definition XmlReader.cs:604
XmlNodeType NodeType
Definition XmlReader.cs:62
virtual string Name
Definition XmlReader.cs:65
void Remove(IComponent? component)
delegate void MergeFailedEventHandler(object sender, MergeFailedEventArgs e)
delegate void DataSetClearEventhandler(object sender, DataTable table)
delegate void DataRowCreatedEventHandler(object sender, DataRow r)
delegate void FillErrorEventHandler(object sender, FillErrorEventArgs e)
readonly BitArray _rowChanges
Definition DataSet.cs:31