public short GetId(SqlLocale locale) { if (locale == null) { throw new ArgumentNullException("locale"); } foreach (SqlLocale l in m_Locales.Values) { bool localeCodeMatch = false; if (((l.LocaleCode == null) && (locale.LocaleCode == null)) || ((l.LocaleCode != null) && (locale.LocaleCode != null) && (String.Compare(l.LocaleCode, locale.LocaleCode, StringComparison.OrdinalIgnoreCase) == 0))) { localeCodeMatch = true; } bool LocaleNameMatch = false; if (((l.LocaleName == null) && (locale.LocaleName == null)) || ((l.LocaleName != null) && (locale.LocaleName != null) && (String.Compare(l.LocaleName, locale.LocaleName, StringComparison.OrdinalIgnoreCase) == 0))) { LocaleNameMatch = true; } if (localeCodeMatch && LocaleNameMatch) { return(l.LocaleId); } } return(-1); }
public void Add(SqlLocale newValue) { if (newValue == null) { throw new ArgumentNullException("newValue"); } m_Locales.Add(newValue.LocaleId, newValue); }