Exemple #1
0
        /// <summary>
        /// Returns the CSS representation of the linear gradient function.
        /// </summary>
        /// <returns>A string that resembles CSS code.</returns>
        public String ToCss()
        {
            var position = new [] { _width.ToCss(), _height.ToCss(), Keywords.At, _x.ToCss(), _y.ToCss() };

            return(FunctionNames.Build(_repeating ? FunctionNames.RepeatingRadialGradient : FunctionNames.RadialGradient,
                                       String.Join(" ", position), String.Join(", ", _stops.Select(m => m.ToCss()))));
        }
Exemple #2
0
        /// <summary>
        /// Returns the CSS representation of the specified counter.
        /// </summary>
        /// <returns>The CSS counter or counters function code.</returns>
        public String ToCss()
        {
            if (_separator != null)
            {
                if (_listStyle != null)
                {
                    return(FunctionNames.Build(FunctionNames.Counters, _identifier, _separator, _listStyle));
                }

                return(FunctionNames.Build(FunctionNames.Counters, _identifier, _separator));
            }
            else if (_listStyle != null)
            {
                return(FunctionNames.Build(FunctionNames.Counter, _identifier, _listStyle));
            }

            return(FunctionNames.Build(FunctionNames.Counter, _identifier));
        }
 /// <summary>
 /// Returns the CSS representation of the cubic bezier timing function.
 /// </summary>
 /// <returns>A string that resembles CSS code.</returns>
 public override String ToCss()
 {
     return FunctionNames.Build(FunctionNames.CubicBezier, 
         X1.ToString(CultureInfo.InvariantCulture), Y1.ToString(CultureInfo.InvariantCulture), 
         X2.ToString(CultureInfo.InvariantCulture), Y2.ToString(CultureInfo.InvariantCulture));
 }
 /// <summary>
 /// Returns the CSS representation of the linear gradient function.
 /// </summary>
 /// <returns>A string that resembles CSS code.</returns>
 public String ToCss()
 {
     return(FunctionNames.Build(_repeating ? FunctionNames.RepeatingLinearGradient : FunctionNames.LinearGradient,
                                _angle.ToCss(), String.Join(", ", _stops.Select(m => m.ToCss()))));
 }
Exemple #5
0
 /// <summary>
 /// Returns a CSS representation of the length.
 /// </summary>
 /// <returns>The CSS value string.</returns>
 public String ToCss()
 {
     return(FunctionNames.Build(FunctionNames.Rgba, red.ToString(), green.ToString(), blue.ToString(), Alpha.ToString("0.##", CultureInfo.InvariantCulture)));
 }
Exemple #6
0
 /// <summary>
 /// Returns the CSS representation of the transformation matrix.
 /// </summary>
 /// <returns>The string containing the CSS function.</returns>
 public String ToCss()
 {
     return(FunctionNames.Build(FunctionNames.Matrix3d, _m11.ToString(CultureInfo.InvariantCulture), _m12.ToString(CultureInfo.InvariantCulture), _m13.ToString(CultureInfo.InvariantCulture), _m21.ToString(CultureInfo.InvariantCulture), _m22.ToString(CultureInfo.InvariantCulture), _m23.ToString(CultureInfo.InvariantCulture), _m31.ToString(CultureInfo.InvariantCulture), _m32.ToString(CultureInfo.InvariantCulture), _m33.ToString(CultureInfo.InvariantCulture), _tx.ToString(CultureInfo.InvariantCulture), _ty.ToString(CultureInfo.InvariantCulture), _tz.ToString(CultureInfo.InvariantCulture)));
 }
Exemple #7
0
 /// <summary>
 /// Returns the string representation of the function in CSS code.
 /// </summary>
 /// <returns>The CSS code to construct this value.</returns>
 public String ToCss()
 {
     return(FunctionNames.Build(FunctionNames.Rect, _top.ToCss(), _right.ToCss(), _bottom.ToCss(), _left.ToCss()));
 }
 /// <summary>
 /// Returns the CSS representation of the steps timing function.
 /// </summary>
 /// <returns>A string that resembles CSS code.</returns>
 public override String ToCss()
 {
     return(FunctionNames.Build(FunctionNames.Steps, Intervals.ToString(CultureInfo.InvariantCulture), IsStart ? Keywords.Start : Keywords.End));
 }
Exemple #9
0
 /// <summary>
 /// Returns the CSS standard represenation of the contained string.
 /// </summary>
 /// <returns>A string that contains the CSS code to create the value.</returns>
 public String ToCss()
 {
     return(FunctionNames.Build(FunctionNames.Attr, _name));
 }
Exemple #10
0
 /// <summary>
 /// Returns the CSS standard represenation of the contained string.
 /// </summary>
 /// <returns>A string that contains the CSS code to create the value.</returns>
 public String ToCss()
 {
     return(FunctionNames.Build(FunctionNames.Image, String.Join(", ", _urls.Select(m => ((ICssObject)m).ToCss()))));
 }