mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 05:05:05 +00:00
fix: temp fix for 4-series shenanagans
This commit is contained in:
committed by
Chris Cameron
parent
dbad18925f
commit
4de7944286
@@ -428,48 +428,49 @@ namespace ICD.Common.Utils.Globalization
|
|||||||
}
|
}
|
||||||
|
|
||||||
s_SqlConnectionString = string.Format(SQL_CONNECTION_STRING_FORMAT, databasePath);
|
s_SqlConnectionString = string.Format(SQL_CONNECTION_STRING_FORMAT, databasePath);
|
||||||
using (IcdSqliteConnection sQLiteConnection = new IcdSqliteConnection(s_SqlConnectionString))
|
try
|
||||||
{
|
{
|
||||||
try
|
using (IcdSqliteConnection sQLiteConnection = new IcdSqliteConnection(s_SqlConnectionString))
|
||||||
{
|
{
|
||||||
sQLiteConnection.Open();
|
sQLiteConnection.Open();
|
||||||
}
|
s_IsDatabasePresent = true;
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
s_IsDatabasePresent = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
s_IsDatabasePresent = true;
|
|
||||||
IcdSqliteCommand sQLiteCommand = new IcdSqliteCommand("select count(*) from cultureinfo", sQLiteConnection);
|
|
||||||
int num = Convert.ToInt32(sQLiteCommand.ExecuteScalar());
|
|
||||||
s_AvailableCultureNames = new string[num + 1];
|
|
||||||
IcdSqliteCommand sQLiteCommand2 = new IcdSqliteCommand("select id, name, lcid, isneutralculture from cultureinfo",
|
|
||||||
sQLiteConnection);
|
|
||||||
using (IcdSqliteDataReader sQLiteDataReader = sQLiteCommand2.ExecuteReader())
|
|
||||||
{
|
|
||||||
while (sQLiteDataReader.Read())
|
|
||||||
{
|
|
||||||
int @int = sQLiteDataReader.GetInt32(0);
|
|
||||||
bool boolean = sQLiteDataReader.GetBoolean(3);
|
|
||||||
string @string = sQLiteDataReader.GetString(1);
|
|
||||||
s_DictAvailableCulturesByName[@string] = boolean ? CultureTypes.NeutralCultures : CultureTypes.SpecificCultures;
|
|
||||||
int int2 = sQLiteDataReader.GetInt32(2);
|
|
||||||
s_DictAvailableCulturesByLcid[int2] = boolean ? CultureTypes.NeutralCultures : CultureTypes.SpecificCultures;
|
|
||||||
s_AvailableCultureNames[@int] = @string;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sQLiteCommand2 = new IcdSqliteCommand("select id, specificculture from specificcultureinfo", sQLiteConnection);
|
IcdSqliteCommand sQLiteCommand = new IcdSqliteCommand("select count(*) from cultureinfo", sQLiteConnection);
|
||||||
using (IcdSqliteDataReader sQLiteDataReader2 = sQLiteCommand2.ExecuteReader())
|
int num = Convert.ToInt32(sQLiteCommand.ExecuteScalar());
|
||||||
{
|
s_AvailableCultureNames = new string[num + 1];
|
||||||
while (sQLiteDataReader2.Read())
|
IcdSqliteCommand sQLiteCommand2 = new IcdSqliteCommand("select id, name, lcid, isneutralculture from cultureinfo",
|
||||||
|
sQLiteConnection);
|
||||||
|
using (IcdSqliteDataReader sQLiteDataReader = sQLiteCommand2.ExecuteReader())
|
||||||
{
|
{
|
||||||
int int3 = sQLiteDataReader2.GetInt32(0);
|
while (sQLiteDataReader.Read())
|
||||||
string string2 = sQLiteDataReader2.GetString(1);
|
{
|
||||||
s_DictSpecificCulture[s_AvailableCultureNames[int3]] = string2;
|
int @int = sQLiteDataReader.GetInt32(0);
|
||||||
|
bool boolean = sQLiteDataReader.GetBoolean(3);
|
||||||
|
string @string = sQLiteDataReader.GetString(1);
|
||||||
|
s_DictAvailableCulturesByName[@string] = boolean ? CultureTypes.NeutralCultures : CultureTypes.SpecificCultures;
|
||||||
|
int int2 = sQLiteDataReader.GetInt32(2);
|
||||||
|
s_DictAvailableCulturesByLcid[int2] = boolean ? CultureTypes.NeutralCultures : CultureTypes.SpecificCultures;
|
||||||
|
s_AvailableCultureNames[@int] = @string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sQLiteCommand2 = new IcdSqliteCommand("select id, specificculture from specificcultureinfo", sQLiteConnection);
|
||||||
|
using (IcdSqliteDataReader sQLiteDataReader2 = sQLiteCommand2.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (sQLiteDataReader2.Read())
|
||||||
|
{
|
||||||
|
int int3 = sQLiteDataReader2.GetInt32(0);
|
||||||
|
string string2 = sQLiteDataReader2.GetString(1);
|
||||||
|
s_DictSpecificCulture[s_AvailableCultureNames[int3]] = string2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
s_IsDatabasePresent = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (string name in builtinCultures)
|
foreach (string name in builtinCultures)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user