예제 #1
0
        public string ToCss()
        {
            string text = TextDecoration.ToString().ToLower();

            if (TextDecoration == TextDecoration.LineThrough)
            {
                text = "line-through";
            }

            return(CssStyleBroker.WrapCssClassName(this, String.Format("text-decoration: {0}", text)));
        }
예제 #2
0
        public string ToCss()
        {
            StringBuilder output = new StringBuilder(40);

            if (BackgroundColor != null)
            {
                output.AppendLine(string.Format("background: #{0:X2}{1:X2}{2:X2};", BackgroundColor.Color.R,
                                                BackgroundColor.Color.G,
                                                BackgroundColor.Color.B));
            }
            if (ForegroundColor != null)
            {
                output.AppendLine(string.Format("color: #{0:X2}{1:X2}{2:X2} !important;", ForegroundColor.Color.R,
                                                ForegroundColor.Color.G,
                                                ForegroundColor.Color.B));
            }

            return(CssStyleBroker.WrapCssClassName(this, output.ToString()));
        }
예제 #3
0
        public string ToCss()
        {
            StringBuilder output = new StringBuilder(40);

            if (TextDecoration != TextDecoration.None)
            {
                string text = TextDecoration.ToString().ToLower();
                if (TextDecoration == TextDecoration.LineThrough)
                {
                    text = "line-through";
                }

                output.AppendLine(string.Format("text-decoration: {0};", text));
            }

            if (FontWeight != null && FontWeight.HasValue)
            {
                output.AppendLine(string.Format("font-weight: {0};", FontWeight.Value.Weight));
            }

            if (FontStyle != FontStyle.Normal)
            {
                output.AppendLine(string.Format("font-style: {0};", FontStyle.ToString().ToLower()));
            }

            if (BackgroundColor != null)
            {
                output.AppendLine(string.Format("background: #{0:X2}{1:X2}{2:X2};", BackgroundColor.Color.R,
                                                BackgroundColor.Color.G,
                                                BackgroundColor.Color.B));
            }

            if (ForegroundColor != null)
            {
                output.AppendLine(string.Format("color: #{0:X2}{1:X2}{2:X2} !important;", ForegroundColor.Color.R,
                                                ForegroundColor.Color.G,
                                                ForegroundColor.Color.B));
            }

            return(CssStyleBroker.WrapCssClassName(this, output.ToString()));
        }
예제 #4
0
        public string ToCss()
        {
            StringBuilder output = new StringBuilder(40);

            if (BackgroundColor != null)
            {
                output.AppendLine(string.Format("background: #{0:X2}{1:X2}{2:X2};", BackgroundColor.Color.R,
                                                BackgroundColor.Color.G,
                                                BackgroundColor.Color.B));
            }
#pragma warning disable CS0618 // Type or member is obsolete
            if (ForegroundColor != null)
            {
                output.AppendLine(string.Format("color: #{0:X2}{1:X2}{2:X2} !important;", ForegroundColor.Color.R,
                                                ForegroundColor.Color.G,
                                                ForegroundColor.Color.B));
            }
#pragma warning restore CS0618 // Type or member is obsolete

            return(CssStyleBroker.WrapCssClassName(this, output.ToString()));
        }
예제 #5
0
 public string ToCss()
 {
     return(CssStyleBroker.WrapCssClassName(this, string.Format("background: url(\"{0}\");", GlyphImage.AbsoluteUri)));
 }