internal CompareInfo(CultureInfo ci) { this.culture = ci.LCID; if (UseManagedCollation) { lock (monitor) { if (collators == null) { collators = new Hashtable(); } collator = (SimpleCollator)collators [ci.LCID]; if (collator == null) { collator = new SimpleCollator(ci); collators [ci.LCID] = collator; } } } else { #if !MOONLIGHT this.icu_name = ci.IcuName; this.construct_compareinfo(icu_name); #endif } }
internal CompareInfo(CultureInfo ci) { this.culture = ci.LCID; this.m_name = ci.Name; if (UseManagedCollation) { lock (monitor) { if (collators == null) { collators = new Dictionary <int, SimpleCollator> (); } if (!collators.TryGetValue(ci.LCID, out collator)) { collator = new SimpleCollator(ci); collators [ci.LCID] = collator; } } } else { /* * this.icu_name = ci.IcuName; * this.construct_compareinfo (icu_name); */ } }
void IDeserializationCallback.OnDeserialization(object sender) { if (UseManagedCollation) { collator = new SimpleCollator(new CultureInfo(culture)); } else { /* This will build the ICU collator, and store * the pointer in ICU_collator */ try { this.construct_compareinfo(icu_name); } catch { // ICU_collator=IntPtr.Zero; } } }
SimpleCollator GetCollator() { if (collator != null) { return(collator); } if (collators == null) { Interlocked.CompareExchange(ref collators, new Dictionary <string, SimpleCollator> (StringComparer.Ordinal), null); } lock (collators) { if (!collators.TryGetValue(m_sortName, out collator)) { collator = new SimpleCollator(CultureInfo.GetCultureInfo(m_name)); collators [m_sortName] = collator; } } return(collator); }