Ejemplo n.º 1
0
 public TextStyle(Color color = null,
     float? fontSize = null,
     FontWeight fontWeight = null,
     FontStyle? fontStyle = null,
     float? letterSpacing = null,
     float? wordSpacing = null,
     TextBaseline? textBaseline = null,
     float? height = null,
     TextDecoration decoration = null,
     TextDecorationStyle? decorationStyle = null,
     Color decorationColor = null,
     string fontFamily = null,
     Paint foreground = null,
     Paint background = null,
     List<BoxShadow> shadows = null
 ) {
     this.color = color ?? this.color;
     this.fontSize = fontSize ?? this.fontSize;
     this.fontWeight = fontWeight ?? this.fontWeight;
     this.fontStyle = fontStyle ?? this.fontStyle;
     this.letterSpacing = letterSpacing ?? this.letterSpacing;
     this.wordSpacing = wordSpacing ?? this.wordSpacing;
     this.fontSize = fontSize ?? this.fontSize;
     this.textBaseline = textBaseline ?? this.textBaseline;
     this.height = height ?? this.height;
     this.decoration = decoration ?? this.decoration;
     this.decorationStyle = decorationStyle ?? this.decorationStyle;
     this.decorationColor = decorationColor ?? this.decorationColor;
     this.fontFamily = fontFamily ?? this.fontFamily;
     this.foreground = foreground ?? this.foreground;
     this.background = background ?? this.background;
     this.shadows = shadows ?? this.shadows;
 }
 //--------------------------------------------------------------------------
 internal TextDecoration(ColorType ctbg, Color bg, ColorType cttxt, Color txt, TextDecorationStyle style)
 {
     _bgColor       = bg;
     _bgColorType   = ctbg;
     _textColor     = txt;
     _textColorType = cttxt;
     _style         = style;
 }
Ejemplo n.º 3
0
 public void Clear()
 {
     this.bgtype  = ColorType.DefaultBack;
     this.bgcolor = Gdi::Color.Empty;
     this.fgtype  = ColorType.DefaultText;
     this.fgcolor = Gdi::Color.Empty;
     this.style   = TextDecorationStyle.None;
 }
Ejemplo n.º 4
0
 public TextDecorationConstructor(TextDecoration b)
 {
     this.bgtype  = b.BackColorType;
     this.bgcolor = b.BackColor;
     this.fgtype  = b.TextColorType;
     this.fgcolor = b.TextColor;
     this.style   = b.TextStyle;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Determines if the given value represents a valid state of this property.
        /// </summary>
        /// <param name="value">The state that should be used.</param>
        /// <returns>True if the state is valid, otherwise false.</returns>
        protected override Boolean IsValid(CSSValue value)
        {
            var style = value.ToDecorationStyle();

            if (style.HasValue)
            {
                _style = style.Value;
                return(true);
            }

            return(false);
        }
        protected override Boolean IsValid(CSSValue value)
        {
            TextDecorationStyle style;

            if (value is CSSIdentifierValue && _styles.TryGetValue(((CSSIdentifierValue)value).Value, out style))
            {
                _style = style;
            }
            else if (value != CSSValue.Inherit)
            {
                return(false);
            }

            return(true);
        }
        private TextDecoration(ColorType ctbg, Color bg, ColorType cttxt, Color txt, bool underline, bool bold)
        {
            _bgColor       = bg;
            _bgColorType   = ctbg;
            _textColor     = txt;
            _textColorType = cttxt;

            _style = 0;
            if (underline)
            {
                _style |= TextDecorationStyle.Underline;
            }
            if (bold)
            {
                _style |= TextDecorationStyle.Bold;
            }
        }
Ejemplo n.º 8
0
 public TextStyle(Color color               = null, double?fontSize = null,
                  FontWeight?fontWeight     = null, FontStyle?fontStyle       = null, double?letterSpacing = null,
                  double?wordSpacing        = null, TextBaseline?textBaseline = null, double?height        = null,
                  TextDecoration decoration = null, TextDecorationStyle?decorationStyle = null, Color decorationColor = null,
                  string fontFamily         = null,
                  Paint background          = null
                  )
 {
     this.color           = color ?? this.color;
     this.fontSize        = fontSize ?? this.fontSize;
     this.fontWeight      = fontWeight ?? this.fontWeight;
     this.fontStyle       = fontStyle ?? this.fontStyle;
     this.letterSpacing   = letterSpacing ?? this.letterSpacing;
     this.wordSpacing     = wordSpacing ?? this.wordSpacing;
     this.fontSize        = fontSize ?? this.fontSize;
     this.textBaseline    = textBaseline ?? this.textBaseline;
     this.height          = height ?? this.height;
     this.decoration      = decoration ?? this.decoration;
     this.decorationStyle = decorationStyle ?? this.decorationStyle;
     this.decorationColor = decorationColor ?? this.decorationColor;
     this.fontFamily      = fontFamily ?? this.fontFamily;
     this.background      = background ?? this.background;
 }
Ejemplo n.º 9
0
 internal override void Reset()
 {
     _style = Default;
 }
Ejemplo n.º 10
0
 public void SetDecorationStyle(TextDecorationStyle style)
 {
     _style = style;
 }
Ejemplo n.º 11
0
 internal override void Reset()
 {
     _style = TextDecorationStyle.Solid;
 }
 internal CSSTextDecorationStyleProperty()
     : base(PropertyNames.TextDecorationStyle)
 {
     _inherited = false;
     _style     = TextDecorationStyle.Solid;
 }