From: Michael D. <mik...@us...> - 2004-07-12 01:31:17
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8238/Util Modified Files: PropertiesHelper.cs Log Message: Changed method name in PropertiesHelper from GetInt() to GetInt32() Index: PropertiesHelper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/PropertiesHelper.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PropertiesHelper.cs 29 Mar 2004 04:05:34 -0000 1.5 --- PropertiesHelper.cs 12 Jul 2004 01:31:09 -0000 1.6 *************** *** 14,22 **** bool.Parse(properties[property] as string); } ! //TODO: rename this GetInt32 ! public static int GetInt(string property, IDictionary properties, int defaultValue) { string propValue = properties[property] as string; return (propValue==null) ? defaultValue : int.Parse(propValue); } public static string GetString(string property, IDictionary properties, string defaultValue) { string propValue = properties[property] as string; --- 14,23 ---- bool.Parse(properties[property] as string); } ! ! public static int GetInt32(string property, IDictionary properties, int defaultValue) { string propValue = properties[property] as string; return (propValue==null) ? defaultValue : int.Parse(propValue); } + public static string GetString(string property, IDictionary properties, string defaultValue) { string propValue = properties[property] as string; *************** *** 24,38 **** } ! public static IDictionary ToDictionary(string property, string delim, IDictionary properties) { IDictionary map = new Hashtable(); string propValue = (string) properties[ property ]; ! if (propValue!=null) { ! StringTokenizer tokens = new StringTokenizer(propValue, delim); IEnumerator en = tokens.GetEnumerator(); ! while ( en.MoveNext() ) { string key = (string) en.Current; string value = en.MoveNext() ? (string) en.Current : String.Empty; ! map.Add( key, value ); } } --- 25,42 ---- } ! public static IDictionary ToDictionary(string property, string delim, IDictionary properties) ! { IDictionary map = new Hashtable(); string propValue = (string) properties[ property ]; ! if (propValue!=null) ! { ! StringTokenizer tokens = new StringTokenizer(propValue, delim, false); IEnumerator en = tokens.GetEnumerator(); ! while ( en.MoveNext() ) ! { string key = (string) en.Current; string value = en.MoveNext() ? (string) en.Current : String.Empty; ! map[key] = value; } } |