aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r--OpenSim/Framework/Util.cs22
1 files changed, 21 insertions, 1 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 0545365..724e38b 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -875,7 +875,7 @@ namespace OpenSim.Framework
875 return FileName; 875 return FileName;
876 } 876 }
877 877
878 // Nini (config) related Methods 878 #region Nini (config) related Methods
879 public static IConfigSource ConvertDataRowToXMLConfig(DataRow row, string fileName) 879 public static IConfigSource ConvertDataRowToXMLConfig(DataRow row, string fileName)
880 { 880 {
881 if (!File.Exists(fileName)) 881 if (!File.Exists(fileName))
@@ -898,6 +898,26 @@ namespace OpenSim.Framework
898 } 898 }
899 } 899 }
900 900
901 public static string GetConfigVarWithDefaultSection(IConfigSource config, string varname, string section)
902 {
903 // First, check the Startup section, the default section
904 IConfig cnf = config.Configs["Startup"];
905 if (cnf == null)
906 return string.Empty;
907 string val = cnf.GetString(varname, string.Empty);
908
909 // Then check for an overwrite of the default in the given section
910 if (!string.IsNullOrEmpty(section))
911 {
912 cnf = config.Configs[section];
913 if (cnf != null)
914 val = cnf.GetString(varname, val);
915 }
916
917 return val;
918 }
919 #endregion
920
901 public static float Clip(float x, float min, float max) 921 public static float Clip(float x, float min, float max)
902 { 922 {
903 return Math.Min(Math.Max(x, min), max); 923 return Math.Min(Math.Max(x, min), max);