using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Svg { /// /// Holds a dictionary of the default values of the SVG specification /// public static class SvgDefaults { //internal dictionary for the defaults private static readonly Dictionary _defaults = new Dictionary(); static SvgDefaults() { _defaults["d"] = ""; _defaults["viewBox"] = "0, 0, 0, 0"; _defaults["visibility"] = "visible"; _defaults["opacity"] = "1"; _defaults["clip-rule"] = "nonzero"; _defaults["transform"] = ""; _defaults["rx"] = "0"; _defaults["ry"] = "0"; _defaults["cx"] = "0"; _defaults["cy"] = "0"; _defaults["fill"] = ""; _defaults["fill-opacity"] = "1"; _defaults["fill-rule"] = "nonzero"; _defaults["stroke"] = "none"; _defaults["stroke-opacity"] = "1"; _defaults["stroke-width"] = "1"; _defaults["stroke-miterlimit"] = "4"; _defaults["stroke-linecap"] = "butt"; _defaults["stroke-linejoin"] = "miter"; _defaults["stroke-dasharray"] = "none"; _defaults["stroke-dashoffset"] = "0"; } /// /// Checks whether the property value is the default value of the svg definition. /// /// Name of the svg attribute /// .NET value of the attribute public static bool IsDefault(string attributeName, string value) { if (_defaults.ContainsKey(attributeName)) { if (_defaults[attributeName] == value) return true; } return false; } } }