public static ExtractStyleValue ( string inputText, string>.Dictionary |
||
inputText | string | |
dic | string>.Dictionary | |
return | void |
private void SetStyle(string styleString) { Dictionary <string, string> _dictionary = new Dictionary <string, string>(); SVGStringExtractor.ExtractStyleValue(styleString, ref _dictionary); if (_dictionary.ContainsKey("fill")) { string fill = _dictionary["fill"]; if (fill.Contains("url")) { _gradientID = SVGStringExtractor.ExtractUrl4Gradient(fill); } else { _fillColor = new SVGColor(fill); } } if (_dictionary.ContainsKey("stroke")) { _strokeColor = new SVGColor(_dictionary["stroke"]); } if (_dictionary.ContainsKey("stroke-width")) { isStrokeWidth = true; _strokeWidth = new SVGLength(_dictionary["stroke-width"]); } if (_dictionary.ContainsKey("stroke-linecap")) { SetStrokeLineCap(_dictionary["stroke-linecap"]); } if (_dictionary.ContainsKey("stroke-linejoin")) { SetStrokeLineJoin(_dictionary["stroke-linejoin"]); } }
private void ReadStyle(string styleString) { if (string.IsNullOrEmpty(styleString)) { return; } Dictionary <string, string> _dictionary = new Dictionary <string, string>(); SVGStringExtractor.ExtractStyleValue(styleString, ref _dictionary); ReadStyle(_dictionary); }