private static void WritePinboardXml(XmlWriter writer, PinboardFileV1 data) { writer.WriteStartElement("Pinboard"); writer.WriteAttributeString("Format", "1"); WriteRectangleXml(writer, data.ScreenRectInfo); WriteRectanglesXml(writer, data); writer.WriteEndElement(); }
private static void WriteRectanglesXml(XmlWriter writer, PinboardFileV1 data) { writer.WriteStartElement("Rectangles"); foreach (var rectInfo in data.RectInfos) { WriteRectangleXml(writer, rectInfo); } writer.WriteEndElement(); }
private static void WriteRectangleXml(XmlWriter writer, PinboardFileV1.RectangleInfo rectInfo) { writer.WriteStartElement("Rectangle"); writer.WriteElementString("Name", rectInfo.Name.ToString()); writer.WriteElementString("X", rectInfo.X.ToString()); writer.WriteElementString("Y", rectInfo.Y.ToString()); writer.WriteElementString("Width", rectInfo.Width.ToString()); writer.WriteElementString("Height", rectInfo.Height.ToString()); WriteColorXml(writer, rectInfo.Color); writer.WriteEndElement(); }
private PinboardFileV1 ReadPinboardXml() { PinboardFileV1 data = new PinboardFileV1(); reader.ReadStartElement("Pinboard"); reader.MoveToContent(); data.ScreenRectInfo = ReadRectangleXml(); data.RectInfos = ReadRectanglesXml(); reader.ReadEndElement(); reader.MoveToContent(); return(data); }
private PinboardFileV1 ReadPinboardXml() { PinboardFileV1 data = new PinboardFileV1(); reader.ReadStartElement("Pinboard"); reader.MoveToContent(); data.ScreenRectInfo = ReadRectangleXml(); data.RectInfos = ReadRectanglesXml(); reader.ReadEndElement(); reader.MoveToContent(); return data; }
public static void WriteXml(XmlWriter writer, PinboardFileV1 data) { WritePinboardXml(writer, data); }