예제 #1
0
        internal static string GetSafeReasonText(FaultReason reason)
        {
            if (reason == null)
            {
                return(SR.SFxUnknownFaultNullReason0);
            }

            try
            {
                return(reason.GetMatchingTranslation(System.Globalization.CultureInfo.CurrentCulture).Text);
            }
            catch (ArgumentException)
            {
                if (reason.Translations.Count == 0)
                {
                    return(SR.SFxUnknownFaultZeroReasons0);
                }
                else
                {
                    return(SR.Format(SR.SFxUnknownFaultNoMatchingTranslation1, reason.Translations[0].Text));
                }
            }
        }