Exemplo n.º 1
0
        // Token: 0x06001004 RID: 4100 RVA: 0x00063880 File Offset: 0x00061A80
        internal static string GetStyleContentFromUserOption(UserOptions options, bool needJavascriptEncode)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }
            StringBuilder stringBuilder = new StringBuilder(150);

            stringBuilder.Append("font-family:");
            if (needJavascriptEncode)
            {
                stringBuilder.Append(Utilities.JavascriptEncode(options.ComposeFontName));
            }
            else
            {
                stringBuilder.Append(options.ComposeFontName);
            }
            stringBuilder.Append("; ");
            stringBuilder.Append("font-size:");
            stringBuilder.Append(Utilities.ConvertFromFontSize(options.ComposeFontSize));
            stringBuilder.Append("pt; ");
            if (Utilities.IsFlagSet((int)options.ComposeFontFlags, 1))
            {
                stringBuilder.Append("font-weight:bold; ");
            }
            if (Utilities.IsFlagSet((int)options.ComposeFontFlags, 2))
            {
                stringBuilder.Append("font-style:italic; ");
            }
            if (Utilities.IsFlagSet((int)options.ComposeFontFlags, 4))
            {
                stringBuilder.Append("text-decoration:underline; ");
            }
            return(stringBuilder.ToString());
        }
Exemplo n.º 2
0
        public static SanitizedHtmlString GetDefaultUserFontStyle(UserContext userContext)
        {
            UserOptions userOptions = userContext.UserOptions;
            SanitizingStringBuilder <OwaHtml> sanitizingStringBuilder = new SanitizingStringBuilder <OwaHtml>(256);
            FontFlags composeFontFlags = userOptions.ComposeFontFlags;

            sanitizingStringBuilder.Append("direction: ");
            sanitizingStringBuilder.Append(userContext.IsRtl ? "rtl" : "ltr");
            sanitizingStringBuilder.Append <char>(';');
            sanitizingStringBuilder.Append("font-family: ");
            sanitizingStringBuilder.Append <SanitizedJScriptString>(new SanitizedJScriptString(userOptions.ComposeFontName));
            sanitizingStringBuilder.Append <char>(';');
            sanitizingStringBuilder.Append("color: ");
            sanitizingStringBuilder.Append <SanitizedJScriptString>(new SanitizedJScriptString(userOptions.ComposeFontColor));
            sanitizingStringBuilder.Append <char>(';');
            sanitizingStringBuilder.Append("font-size: ");
            sanitizingStringBuilder.Append(ReplyForwardUtilities.fontSizeMapping[userOptions.ComposeFontSize]);
            sanitizingStringBuilder.Append <char>(';');
            return(sanitizingStringBuilder.ToSanitizedString <SanitizedHtmlString>());
        }
Exemplo n.º 3
0
 // Token: 0x06001005 RID: 4101 RVA: 0x00063960 File Offset: 0x00061B60
 internal static string GetStyleFromUserOption(UserOptions options)
 {
     return('{' + OwaPlainTextStyle.GetStyleContentFromUserOption(options, false) + '}');
 }