// -------------------------------------------------------------- public static void Write(XmlWriter writer, Pen pen) { XBrush.Write(writer, (SolidColorBrush)pen.Brush); writer.WriteStartAttribute(cnThickness); writer.WriteValue(pen.Thickness); writer.WriteEndAttribute(); }
// -------------------------------------------------------------- public static Pen Read(XmlReader reader) { Brush b = XBrush.Read(reader); if (reader.MoveToAttribute(cnThickness)) { return(new Pen(b, reader.ReadContentAsDouble())); } else { throw new FormatException(); } }