/// <summary> /// 暂未使用 /// </summary> /// <param name="item"></param> /// <returns></returns> public static XElement ToXml(LegendItem item) { if (item == null) { return(null); } else { return(new XElement("LegendItem", new XAttribute("text", item.Text), new XAttribute("color", item.Color.ToArgb()))); } }
/// <summary> /// 暂未使用 /// </summary> /// <param name="xml"></param> /// <returns></returns> public static LegendItem ToLegendItem(XElement xml) { if (xml == null) { return(null); } string text = xml.Attribute("text").Value; int color = int.Parse(xml.Attribute("color").Value); LegendItem item = new LegendItem(xml.Attribute("text").Value, Color.FromArgb(color)); return(item); }