Exemple #1
0
        ISimpleCollator GetCollator()
        {
#if WASM
            return(null);
#else
            if (collator != null)
            {
                return(collator);
            }

            if (collators == null)
            {
                Interlocked.CompareExchange(ref collators, new Dictionary <string, ISimpleCollator> (StringComparer.Ordinal), null);
            }

            lock (collators) {
                if (!collators.TryGetValue(_sortName, out collator))
                {
                    collator = new SimpleCollator(CultureInfo.GetCultureInfo(m_name));
                    collators [_sortName] = collator;
                }
            }

            return(collator);
#endif
        }
Exemple #2
0
        ISimpleCollator GetCollator()
        {
            if (!MonoLinkerSupport.IsFeatureSupported(MonoLinkerFeature.Martin))
            {
                return(null);
            }

            if (collator != null)
            {
                return(collator);
            }

            if (collators == null)
            {
                Interlocked.CompareExchange(ref collators, new Dictionary <string, ISimpleCollator> (StringComparer.Ordinal), null);
            }

            TestHelpers.AssertRemoved();

            lock (collators) {
                if (!collators.TryGetValue(_sortName, out collator))
                {
                    collator = new SimpleCollator(CultureInfo.GetCultureInfo(m_name));
                    collators [_sortName] = collator;
                }
            }

            return(collator);
        }