System.Globalization.I18NComplete.OnGetting___ C# (CSharp) Méthode

OnGetting___() static private méthode

Throws the Getting___ global event

@Alias GetRaw and FormatRaw

Translates the given html applying string.Format(html, arguments.Select(a => escapeArgumentFunc(a))) to the current culture language.

For each argument the escape func will be called before applying the format

static private OnGetting___ ( System.Web.Mvc.MvcHtmlString defaultResult, CultureInfo culture, string html, string>.Func escapeArgumentFunc, object htmlArguments ) : System.Web.Mvc.MvcHtmlString
defaultResult System.Web.Mvc.MvcHtmlString The I18NComplete default result. Returning null will fallback on this result, otherwise return a custom value to oveerride this.
culture CultureInfo The culture this translation is being translated
html string The text to be translated
escapeArgumentFunc string>.Func The func to be applied for each argument .i.e. a => HttpUtility.HtmlAttributeEncode(a)
htmlArguments object The html arguments to be applied. For each argument will apply the escape func!
Résultat System.Web.Mvc.MvcHtmlString
        internal static MvcHtmlString OnGetting___(MvcHtmlString defaultResult, CultureInfo culture, string html, Func<object, string> escapeArgumentFunc, object[] htmlArguments)
        {
            if (Getting___e != null)
                return Getting___e(defaultResult, culture, html, escapeArgumentFunc, htmlArguments);
            return null;
        }

Same methods

I18NComplete::OnGetting___ ( System.Web.Mvc.MvcHtmlString defaultResult, CultureInfo culture, string html, object htmlArguments ) : System.Web.Mvc.MvcHtmlString

Usage Example

        /// <summary>
        ///     <para>@Alias <c>GetRaw</c> and <c>FormatRaw</c></para>
        ///     <para>Translates the given html applying string.Format(html, htmlArguments) to the current culture language. </para>
        ///     <para>Warning! Neither the html nor the htmlArguments will be encoded whatsoever</para>
        /// </summary>
        /// <param name="culture">The culture being extended</param>
        /// <param name="html">The html to be translated</param>
        /// <param name="htmlArguments">The html arguments to be applied. Warning! The arguments will not be htmlEncoded!</param>
        /// <returns>The translated formatted html as MvcHtmlString</returns>
        /// <created author="laurentiu.macovei" date="Fri, 06 Jan 2012 23:46:39 GMT"/>
        public static MvcHtmlString ___(this CultureInfo culture, string html, params object[] htmlArguments)
        {
            var result = new MvcHtmlString(string.Format(I18NComplete.GetText(html, lcid: culture.LCID), htmlArguments));

            return
                (#if DEBUG
                 I18NComplete.OnGetting___(result, culture, html, htmlArguments) ??
#endif
                 result);
        }
All Usage Examples Of System.Globalization.I18NComplete::OnGetting___