Пример #1
0
        /// <summary>
        /// Gets the line cap
        /// </summary>
        /// <returns></returns>
        private GraphicLineCap GetLineCap()
        {
            GraphicLineCap lineCap = GraphicLineCap.Flat;

            var strVal = cssStyleCascade.GetProperty("stroke-linecap");

            if (string.IsNullOrEmpty(strVal))
            {
                return(lineCap);
            }

            switch (strVal)
            {
            case "butt":
                lineCap = GraphicLineCap.Flat;
                break;

            case "round":
                lineCap = GraphicLineCap.Round;
                break;

            case "square":
                lineCap = GraphicLineCap.Square;
                break;
            }

            return(lineCap);
        }
Пример #2
0
        /// <summary>
        /// Get an attribute as double from the cascade
        /// </summary>
        public static double GetNumber(this CssStyleCascade cssStyleCascade, string name, double defaultValue)
        {
            double retVal = defaultValue;

            var strVal = cssStyleCascade.GetProperty(name);

            if (!string.IsNullOrEmpty(strVal))
            {
                retVal = DoubleParser.GetNumber(strVal);
            }

            return(retVal);
        }