Example #1
0
        /// <summary>
        /// Returns the translated string for the specified <see cref="CultureInfo"/>, using the passed <see cref="CultureInfo"/>.
        /// If no <see cref="CultureInfo.CurrentCulture"/> is passed, the <see cref="CultureInfo"/> is used.
        /// </summary>
        /// <param name="code">The <see cref="TranslationCode"/>.</param>
        /// <param name="cultureInfo">The <see cref="TranslationCode"/> (optional).</param>
        /// <returns>The translated text.</returns>
        public static string GetTranslation(this TranslationCode code, CultureInfo cultureInfo = null)
        {
            cultureInfo ??= CultureInfo.CurrentCulture;

            return(Exceptions.ResourceManager
                   .GetString(code.ToString(), cultureInfo));
        }
Example #2
0
 public SandoException(TranslationCode translationCode, Exception innerException)
     : base(Translator.GetTranslation(translationCode), innerException)
 {
 }
Example #3
0
 public SandoException(TranslationCode translationCode, Exception innerException, object[] exceptionMessageFormatArgs)
     : base(String.Format(Translator.GetTranslation(translationCode), exceptionMessageFormatArgs), innerException)
 {
 }
Example #4
0
 public ParserException(TranslationCode translationCode, String exceptionMessageFormatArg)
     : base(translationCode, null, exceptionMessageFormatArg)
 {
 }
Example #5
0
 public static string GetTranslation(TranslationCode translationCode)
 {
     return Translations.ResourceManager.GetString(translationCode.ToString());
 }
Example #6
0
 public IndexerException(TranslationCode translationCode, Exception innerException)
     : base(translationCode, innerException)
 {
 }
Example #7
0
 public IndexerException(TranslationCode translationCode, Exception innerException, object[] exceptionMessageFormatArgs)
     : base(translationCode, innerException, exceptionMessageFormatArgs)
 {
 }
Example #8
0
 public ParserException(TranslationCode translationCode, String exceptionMessageFormatArg)
     : base(translationCode, null, exceptionMessageFormatArg)
 {
 }
 public IndexerException(TranslationCode translationCode, Exception innerException, object[] exceptionMessageFormatArgs)
     : base(translationCode, innerException, exceptionMessageFormatArgs)
 {
 }
Example #10
0
 public IndexerException(TranslationCode translationCode, Exception innerException)
     : base(translationCode, innerException)
 {
 }
Example #11
0
 public static string GetTranslation(TranslationCode translationCode)
 {
     return(Translations.ResourceManager.GetString(translationCode.ToString()));
 }