/// <summary>
        /// Register new transliteration
        /// </summary>
        public static bool Register(ITransliteration value)
        {
            if (null == value)
            {
                return(false);
            }

            return(s_Items.TryAdd(value, true));
        }
 /// <summary>
 /// Reversed
 /// </summary>
 /// <param name="source"></param>
 /// <returns></returns>
 public static ITransliteration Reversed(this ITransliteration source)
 {
     if (null == source)
     {
         throw new ArgumentNullException(nameof(source));
     }
     else if (source.LanguageFrom == source.LanguageTo || source.Direct == source.Reverse)
     {
         return(source);
     }
     else
     {
         return(new TransliterationReversed(source));
     }
 }
        /// <summary>
        /// Equals
        /// </summary>
        public bool Equals(ITransliteration other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            else if (null == other)
            {
                return(false);
            }

            return(LanguageFrom == other.LanguageFrom &&
                   LanguageTo == other.LanguageTo &&
                   string.Equals(Name, other.Name));
        }
 public TransliterationReversed(ITransliteration source)
 {
     m_Source = source ?? throw new ArgumentNullException(nameof(source));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Register new transliteration
 /// </summary>
 public static bool Register(ITransliteration value) =>
 (value is not null) && s_Items.TryAdd(value, true);
Exemplo n.º 6
0
 public Engine(ITransliteration transliteration)
 {
     this._Transliteration = transliteration;
 }