Exemplo n.º 1
0
 public static bool ValidateSortRules(string rules, out string message)
 {
     Collator.CollationRuleErrorInfo errorInfo = Collator.CheckRules(LdmlCollationParser.ReplaceUnicodeEscapesForIcu(rules));
     if (errorInfo != null)
     {
         message = string.Format("Invalid ICU rules (Line: {0}, Column: {1}).", errorInfo.Line, errorInfo.Offset);
         return(false);
     }
     message = null;
     return(true);
 }
Exemplo n.º 2
0
 public IcuRulesCollator(string rules)
 {
     try
     {
         _collator = new RuleBasedCollator(LdmlCollationParser.ReplaceUnicodeEscapesForIcu(rules));
     }
     catch (DllNotFoundException e)
     {
         throw new DllNotFoundException("IcuRulesCollator requires the ICU dlls to be present", e);
     }
 }
Exemplo n.º 3
0
 public IcuRulesCollator(string rules)
 {
     try
     {
         lock (((ICollection)_createdCollators).SyncRoot)
         {
             _collator = new RuleBasedCollator(LdmlCollationParser.ReplaceUnicodeEscapesForIcu(rules));
             _createdCollators.Add(_collator, this);
         }
     }
     catch (DllNotFoundException e)
     {
         throw new DllNotFoundException("IcuRulesCollator requires the ICU dlls to be present", e);
     }
 }