public class SvgStyle
{
    public string GetStyle(string Name, string Value)
    {
        if ((Value == null) || (Name == null))
            return "";
        return Name + ":" + Value + ";";
    }
    private string _fill = "none";
    public string fill_opacity = "1";
    public string fill_rule = "evenodd";
    private string _stroke = "#000000";
    public string stroke_width = "0.1";
    public string stroke_miterlimit = "4";
    public string stroke_opacity = "1";
    public string stroke_dasharray = "none";
    public string stroke_linecap = "round";
    public string stroke_linejoin = "round";
    public string stroke
    {
        get
        {
            return _stroke;
        }
        set
        {
            _stroke = SetColor(value);
        }
    }
    public string fill
    {
        get
        {
            return _fill;
        }
        set
        {
            _fill = SetColor(value);
        }
    }
    private string SetColor(string strColor)
    {
        if (strColor.ToLower() == "none")
            return "none";
        if (!strColor.StartsWith("#"))
            strColor = "#" + strColor;
        return strColor;
    }
    public string GetSvgStyle()
    {
        return
            GetStyle("fill", fill) +
            GetStyle("fill-opacity", fill_opacity) +
            GetStyle("fill-rule", fill_rule) +
            GetStyle("stroke", stroke) +
            GetStyle("stroke-width", stroke_width) +
            GetStyle("stroke-miterlimit", stroke_miterlimit) +
            GetStyle("stroke-opacity", stroke_opacity) +
            GetStyle("stroke-dasharray", stroke_dasharray) +
            GetStyle("stroke-linecap", stroke_linecap) +
            GetStyle("stroke-linejoin", stroke_linejoin);
    }
}
public class SvgAttribute
{
    protected string _Name;
    protected string _Value;
    public string Value
    {
        set
        {
            if (value == null)
                return;
            if (value == "")
                return;
            _Value = value;
        }
    }
    public SvgAttribute(string Name, string Value)
    {
        _Name = Name;
        _Value = Value;
    }
    protected SvgAttribute()
    {
    }
    public string Get()
    {
        if ((_Value == null) || (_Name == null))
            return "";
        if ((_Value == "") || (_Name == ""))
            return "";
        return _Name + ":" + _Value + ";";
    }
}
public class SvgColor : SvgAttribute
{
    private string SetColor(string strColor)
    {
        if (strColor.ToLower() == "none")
            return "none";
        if (!strColor.StartsWith("#"))
            strColor = "#" + strColor;
        return strColor;
    }
    public SvgColor(string Name0, string Value0)
        : base()
    {
        _Name = Name0;
        _Value = SetColor(Value0);
    }
    public new string Value
    {
        set
        {
            if (value == null)
                return;
            if (value == "")
                return;
            _Value = SetColor(value);
        }
    }
}
public class SvgStyleText
{
    private SvgAttribute FontFamily = new SvgAttribute("font-family", "Tahoma");
    private SvgAttribute FontSize = new SvgAttribute("font-size", "10");
    private SvgAttribute FontWeight = new SvgAttribute("font-weight", "bold");
    private SvgColor Fill = new SvgColor("fill", "000000");
    private SvgAttribute FillOpacity = new SvgAttribute("fill-opacity", "1");
    private SvgAttribute TextAlign = new SvgAttribute("text-align", "center");
    private SvgAttribute TextAnchor = new SvgAttribute("text-anchor", "middle");
    public string GetSvgStyle()
    {
        return
            FontFamily.Get() +
            FontSize.Get() +
            FontWeight.Get() +
            Fill.Get() +
            FillOpacity.Get() +
            TextAlign.Get() +
            TextAnchor.Get();
    }
    public void Set(string[] Attributes)
    {
        FontFamily.Value = Attributes[0];
        FontSize.Value = Attributes[1];
        FontWeight.Value = Attributes[2];
        Fill.Value = Attributes[3];
        TextAlign.Value = Attributes[4];
        TextAnchor.Value = Attributes[5];
    }
}
