OnGetting___() static private method

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!
return System.Web.Mvc.MvcHtmlString
コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <summary>
        ///     <para>@Alias <c>GetRaw</c> and <c>FormatRaw</c></para>
        ///     <para>Translates the given html applying string.Format(html, arguments.Select(a =&gt; escapeArgumentFunc(a))) to the current culture language. </para>
        ///     <para>For each argument the escape func will be called before applying the format</para>
        /// </summary>
        /// <param name="culture">The culture being extended</param>
        /// <param name="html">The text to be translated</param>
        /// <param name="htmlArguments">The html arguments to be applied. For each argument will apply the escape func!</param>
        /// <param name="escapeArgumentFunc">The func to be applied for each argument .i.e. <c>a =&gt; HttpUtility.HtmlAttributeEncode(a)</c></param>
        /// <returns>The translated formatted html as MvcHtmlString</returns>
        /// <created author="laurentiu.macovei" date="Fri, 06 Jan 2012 23:46:56 GMT"/>
        public static MvcHtmlString ___(this CultureInfo culture, string html, Func <object, string> escapeArgumentFunc, params object[] htmlArguments)
        {
            var result = new MvcHtmlString(string.Format(I18NComplete.GetText(html, lcid: culture.LCID), htmlArguments
                                                         .Select(a => escapeArgumentFunc(a)).ToArray()));

            return
                (#if DEBUG
                 I18NComplete.OnGetting___(result, CultureInfo.CurrentCulture, html, escapeArgumentFunc, htmlArguments) ??
#endif
                 result);
        }