Exemplo n.º 1
0
        public override string ToString()
        {
            string result = "Fill " + FillColor.ToString();

            if (Mode != FillMode.Solid)
            {
                result += " " + Mode.ToString() + " " + GradientColor.ToString();
            }
            return(result);
        }
 public override int GetHashCode()
 {
     return(string.Concat(FillColor.ToString(), StrokeColor.ToString(), StrokeWidth.GetHashCode()).GetHashCode());
     //return ComputeStringHash(FillColor, StrokeColor, StrokeWidth);
     //unchecked
     //{
     //	int hash = FillColor.ToString().GetHashCode();
     //	// Maybe nullity checks, if these are objects not primitives!
     //	hash = hash * 29 + StrokeColor.ToString().GetHashCode();
     //	hash = hash * 29 + StrokeWidth.ToString().GetHashCode();
     //	return hash;
     //}
 }
Exemplo n.º 3
0
 public void WriteTo(XElement x)
 {
     if (FillColor != null)
     {
         x.Add(new XAttribute("fill", FillColor.ToString()));
     }
     if (StrokeColor != null)
     {
         x.Add(new XAttribute("stroke", StrokeColor.ToString()));
     }
     if (StrokeWidth.HasValue)
     {
         x.Add(new XAttribute("stroke-width", StrokeWidth));
     }
 }