[pgsqlclient-checkins] pgsqlclient/PostgreSql.Data.PGSqlClient/source/NPGClient PGTypeCollection.cs,
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2003-07-29 10:15:43
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/NPGClient In directory sc8-pr-cvs1:/tmp/cvs-serv1525 Modified Files: PGTypeCollection.cs Log Message: * Changed cultureAwareCompare method in PGDataReader and all Collection classes for use it in a better way, and allow it to run on Mono:: Index: PGTypeCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/NPGClient/PGTypeCollection.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PGTypeCollection.cs 14 Jul 2003 11:59:44 -0000 1.2 --- PGTypeCollection.cs 29 Jul 2003 10:15:40 -0000 1.3 *************** *** 74,78 **** foreach(PGType item in this) { ! if (_cultureAwareCompare(item.Name, name) == 0) { return index; --- 74,78 ---- foreach(PGType item in this) { ! if (cultureAwareCompare(item.Name, name)) { return index; *************** *** 118,124 **** } ! private int _cultureAwareCompare(string strA, string strB) { ! return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase); } --- 118,131 ---- } ! private bool cultureAwareCompare(string strA, string strB) { ! try ! { ! return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase) == 0 ? true : false; ! } ! catch (NotSupportedException) ! { ! return strA.ToUpper() == strB.ToUpper() ? true : false; ! } } |