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

◆ SetLocaleValue()

void System.Data.DataSet.SetLocaleValue ( CultureInfo value,
bool userSet )
inlinepackage

Definition at line 825 of file DataSet.cs.

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 }
887 catch (Exception e) when (ADP.IsCatchableExceptionType(e))
888 {
890 }
891 if (!flag2)
892 {
893 throw ExceptionBuilder.CannotChangeCaseLocale(null);
894 }
895 }
896 }
897 }
static bool IsCatchableExceptionType(Exception e)
Definition ADP.cs:790
static void TraceExceptionWithoutRethrow(Exception e)
Definition ADP.cs:673
bool ShouldSerializeLocale()
Definition DataSet.cs:899
CultureInfo _culture
Definition DataSet.cs:73
DataTableCollection Tables
Definition DataSet.cs:396
bool ValidateLocaleConstraint()
Definition DataSet.cs:2763

References System.Data.DataSet._culture, System.Data.DataSet._cultureUserSet, System.Data.ExceptionBuilder.CannotChangeCaseLocale(), System.culture, System.Runtime.Serialization.Dictionary, System.Data.Common.ADP.IsCatchableExceptionType(), System.Data.DataTable.SetLocaleValue(), System.Data.DataSet.ShouldSerializeLocale(), System.Data.DataTable.ShouldSerializeLocale(), System.Data.DataSet.Tables, System.Data.Common.ADP.TraceExceptionWithoutRethrow(), System.Data.DataSet.ValidateLocaleConstraint(), and System.value.

Referenced by System.Data.XSDSchema.HandleDataSet().