aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Util.cs68
1 files changed, 0 insertions, 68 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index eb3526a..77985bd 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1688,69 +1688,6 @@ namespace OpenSim.Framework
1688 return displayConnectionString; 1688 return displayConnectionString;
1689 } 1689 }
1690 1690
1691 public static T ReadSettingsFromIniFile<T>(IConfig config, T settingsClass)
1692 {
1693 Type settingsType = settingsClass.GetType();
1694
1695 FieldInfo[] fieldInfos = settingsType.GetFields();
1696 foreach (FieldInfo fieldInfo in fieldInfos)
1697 {
1698 if (!fieldInfo.IsStatic)
1699 {
1700 if (fieldInfo.FieldType == typeof(System.String))
1701 {
1702 fieldInfo.SetValue(settingsClass, config.Get(fieldInfo.Name, (string)fieldInfo.GetValue(settingsClass)));
1703 }
1704 else if (fieldInfo.FieldType == typeof(System.Boolean))
1705 {
1706 fieldInfo.SetValue(settingsClass, config.GetBoolean(fieldInfo.Name, (bool)fieldInfo.GetValue(settingsClass)));
1707 }
1708 else if (fieldInfo.FieldType == typeof(System.Int32))
1709 {
1710 fieldInfo.SetValue(settingsClass, config.GetInt(fieldInfo.Name, (int)fieldInfo.GetValue(settingsClass)));
1711 }
1712 else if (fieldInfo.FieldType == typeof(System.Single))
1713 {
1714 fieldInfo.SetValue(settingsClass, config.GetFloat(fieldInfo.Name, (float)fieldInfo.GetValue(settingsClass)));
1715 }
1716 else if (fieldInfo.FieldType == typeof(System.UInt32))
1717 {
1718 fieldInfo.SetValue(settingsClass, Convert.ToUInt32(config.Get(fieldInfo.Name, ((uint)fieldInfo.GetValue(settingsClass)).ToString())));
1719 }
1720 }
1721 }
1722
1723 PropertyInfo[] propertyInfos = settingsType.GetProperties();
1724 foreach (PropertyInfo propInfo in propertyInfos)
1725 {
1726 if ((propInfo.CanRead) && (propInfo.CanWrite))
1727 {
1728 if (propInfo.PropertyType == typeof(System.String))
1729 {
1730 propInfo.SetValue(settingsClass, config.Get(propInfo.Name, (string)propInfo.GetValue(settingsClass, null)), null);
1731 }
1732 else if (propInfo.PropertyType == typeof(System.Boolean))
1733 {
1734 propInfo.SetValue(settingsClass, config.GetBoolean(propInfo.Name, (bool)propInfo.GetValue(settingsClass, null)), null);
1735 }
1736 else if (propInfo.PropertyType == typeof(System.Int32))
1737 {
1738 propInfo.SetValue(settingsClass, config.GetInt(propInfo.Name, (int)propInfo.GetValue(settingsClass, null)), null);
1739 }
1740 else if (propInfo.PropertyType == typeof(System.Single))
1741 {
1742 propInfo.SetValue(settingsClass, config.GetFloat(propInfo.Name, (float)propInfo.GetValue(settingsClass, null)), null);
1743 }
1744 if (propInfo.PropertyType == typeof(System.UInt32))
1745 {
1746 propInfo.SetValue(settingsClass, Convert.ToUInt32(config.Get(propInfo.Name, ((uint)propInfo.GetValue(settingsClass, null)).ToString())), null);
1747 }
1748 }
1749 }
1750
1751 return settingsClass;
1752 }
1753
1754 public static string Base64ToString(string str) 1691 public static string Base64ToString(string str)
1755 { 1692 {
1756 Decoder utf8Decode = Encoding.UTF8.GetDecoder(); 1693 Decoder utf8Decode = Encoding.UTF8.GetDecoder();
@@ -2156,11 +2093,6 @@ namespace OpenSim.Framework
2156 } 2093 }
2157 } 2094 }
2158 2095
2159 public static void FireAndForget(System.Threading.WaitCallback callback)
2160 {
2161 FireAndForget(callback, null);
2162 }
2163
2164 public static void InitThreadPool(int minThreads, int maxThreads) 2096 public static void InitThreadPool(int minThreads, int maxThreads)
2165 { 2097 {
2166 if (maxThreads < 2) 2098 if (maxThreads < 2)