mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
seems to compile ( tests comented out)
This commit is contained in:
@@ -1688,69 +1688,6 @@ namespace OpenSim.Framework
|
||||
return displayConnectionString;
|
||||
}
|
||||
|
||||
public static T ReadSettingsFromIniFile<T>(IConfig config, T settingsClass)
|
||||
{
|
||||
Type settingsType = settingsClass.GetType();
|
||||
|
||||
FieldInfo[] fieldInfos = settingsType.GetFields();
|
||||
foreach (FieldInfo fieldInfo in fieldInfos)
|
||||
{
|
||||
if (!fieldInfo.IsStatic)
|
||||
{
|
||||
if (fieldInfo.FieldType == typeof(System.String))
|
||||
{
|
||||
fieldInfo.SetValue(settingsClass, config.Get(fieldInfo.Name, (string)fieldInfo.GetValue(settingsClass)));
|
||||
}
|
||||
else if (fieldInfo.FieldType == typeof(System.Boolean))
|
||||
{
|
||||
fieldInfo.SetValue(settingsClass, config.GetBoolean(fieldInfo.Name, (bool)fieldInfo.GetValue(settingsClass)));
|
||||
}
|
||||
else if (fieldInfo.FieldType == typeof(System.Int32))
|
||||
{
|
||||
fieldInfo.SetValue(settingsClass, config.GetInt(fieldInfo.Name, (int)fieldInfo.GetValue(settingsClass)));
|
||||
}
|
||||
else if (fieldInfo.FieldType == typeof(System.Single))
|
||||
{
|
||||
fieldInfo.SetValue(settingsClass, config.GetFloat(fieldInfo.Name, (float)fieldInfo.GetValue(settingsClass)));
|
||||
}
|
||||
else if (fieldInfo.FieldType == typeof(System.UInt32))
|
||||
{
|
||||
fieldInfo.SetValue(settingsClass, Convert.ToUInt32(config.Get(fieldInfo.Name, ((uint)fieldInfo.GetValue(settingsClass)).ToString())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PropertyInfo[] propertyInfos = settingsType.GetProperties();
|
||||
foreach (PropertyInfo propInfo in propertyInfos)
|
||||
{
|
||||
if ((propInfo.CanRead) && (propInfo.CanWrite))
|
||||
{
|
||||
if (propInfo.PropertyType == typeof(System.String))
|
||||
{
|
||||
propInfo.SetValue(settingsClass, config.Get(propInfo.Name, (string)propInfo.GetValue(settingsClass, null)), null);
|
||||
}
|
||||
else if (propInfo.PropertyType == typeof(System.Boolean))
|
||||
{
|
||||
propInfo.SetValue(settingsClass, config.GetBoolean(propInfo.Name, (bool)propInfo.GetValue(settingsClass, null)), null);
|
||||
}
|
||||
else if (propInfo.PropertyType == typeof(System.Int32))
|
||||
{
|
||||
propInfo.SetValue(settingsClass, config.GetInt(propInfo.Name, (int)propInfo.GetValue(settingsClass, null)), null);
|
||||
}
|
||||
else if (propInfo.PropertyType == typeof(System.Single))
|
||||
{
|
||||
propInfo.SetValue(settingsClass, config.GetFloat(propInfo.Name, (float)propInfo.GetValue(settingsClass, null)), null);
|
||||
}
|
||||
if (propInfo.PropertyType == typeof(System.UInt32))
|
||||
{
|
||||
propInfo.SetValue(settingsClass, Convert.ToUInt32(config.Get(propInfo.Name, ((uint)propInfo.GetValue(settingsClass, null)).ToString())), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return settingsClass;
|
||||
}
|
||||
|
||||
public static string Base64ToString(string str)
|
||||
{
|
||||
Decoder utf8Decode = Encoding.UTF8.GetDecoder();
|
||||
@@ -2156,11 +2093,6 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
public static void FireAndForget(System.Threading.WaitCallback callback)
|
||||
{
|
||||
FireAndForget(callback, null);
|
||||
}
|
||||
|
||||
public static void InitThreadPool(int minThreads, int maxThreads)
|
||||
{
|
||||
if (maxThreads < 2)
|
||||
|
||||
Reference in New Issue
Block a user