Beispiel #1
0
 public string ToString(Theme t)
 {
     var a = new StylesheetStringBuilder();
     a.AppendAttribute("color", t.ResolveColor(Color));
     a.AppendAttribute("font-family", Family);
     a.AppendAttribute("font-size", Size);
     a.AppendAttribute("font-weight", Weight);
     if (Underline) a.AppendAttribute("text-decoration", "underline");
     if (Italic) a.AppendAttribute("font-style", "italic");
     if (Caps) a.AppendAttribute("text-transform", "uppercase");
     return a.ToString();
 }
Beispiel #2
0
        public string ToString(Theme t)
        {
            var a = new StylesheetStringBuilder();

            a.AppendAttribute("background-color", t.ResolveColor(BackgroundColor));
            a.AppendAttribute("background-image", BackgroundImage);
            a.AppendAttribute("width", Width);
            a.AppendAttribute("height", Height);
            if (null != Margin && !Margin.IsEmpty)
            {
                a.AppendAttribute("margin", Margin.ToString());
            }
            if (null != Padding && !Padding.IsEmpty)
            {
                a.AppendAttribute("padding", Padding.ToString());
            }
            if (ThemeBorder.AreSame(BorderTop, BorderBottom, BorderLeft, BorderRight))
            {
                a.AppendAttribute("border", BorderTop.ToString(t));
            }
            else
            {
                if (null != BorderTop && !BorderTop.IsEmpty)
                {
                    a.AppendAttribute("border-top", BorderTop.ToString(t));
                }
                if (null != BorderBottom && !BorderBottom.IsEmpty)
                {
                    a.AppendAttribute("border-bottom", BorderBottom.ToString(t));
                }
                if (null != BorderLeft && !BorderLeft.IsEmpty)
                {
                    a.AppendAttribute("border-left", BorderLeft.ToString(t));
                }
                if (null != BorderRight && !BorderRight.IsEmpty)
                {
                    a.AppendAttribute("border-right", BorderRight.ToString(t));
                }
            }
            return(a.ToString());
        }
Beispiel #3
0
        public string ToString(Theme t)
        {
            var a = new StylesheetStringBuilder();

            a.AppendAttribute("color", t.ResolveColor(Color));
            a.AppendAttribute("font-family", Family);
            a.AppendAttribute("font-size", Size);
            a.AppendAttribute("font-weight", Weight);
            if (Underline)
            {
                a.AppendAttribute("text-decoration", "underline");
            }
            if (Italic)
            {
                a.AppendAttribute("font-style", "italic");
            }
            if (Caps)
            {
                a.AppendAttribute("text-transform", "uppercase");
            }
            return(a.ToString());
        }
Beispiel #4
0
 public string ToString(Theme t)
 {
     var a = new StylesheetStringBuilder();
     a.AppendAttribute("background-color", t.ResolveColor(BackgroundColor));
     a.AppendAttribute("background-image", BackgroundImage);
     a.AppendAttribute("width", Width);
     a.AppendAttribute("height", Height);
     if (null != Margin && !Margin.IsEmpty) a.AppendAttribute("margin", Margin.ToString());
     if (null != Padding && !Padding.IsEmpty) a.AppendAttribute("padding", Padding.ToString());
     if (ThemeBorder.AreSame(BorderTop, BorderBottom, BorderLeft, BorderRight))
     {
         a.AppendAttribute("border", BorderTop.ToString(t));
     }
     else
     {
         if (null != BorderTop && !BorderTop.IsEmpty) a.AppendAttribute("border-top", BorderTop.ToString(t));
         if (null != BorderBottom && !BorderBottom.IsEmpty) a.AppendAttribute("border-bottom", BorderBottom.ToString(t));
         if (null != BorderLeft && !BorderLeft.IsEmpty) a.AppendAttribute("border-left", BorderLeft.ToString(t));
         if (null != BorderRight && !BorderRight.IsEmpty) a.AppendAttribute("border-right", BorderRight.ToString(t));
     }            
     return a.ToString();
 }