public virtual void WriteXml(XmlWriter writer) { if (!string.IsNullOrEmpty(Namespace)) { var name = string.IsNullOrEmpty(Prefix) ? "xmlns" : $"xmlns:{Prefix}"; writer.WriteAttributeString(name, Namespace); } writer.WriteAttributeString("index", Index.ToString()); writer.WriteAttributeString("name", Name); writer.WriteAttributeString("font", FontFamily); if (!Color.Equals(Transparent) && !Color.Equals(Automatic)) { writer.WriteAttributeString("fontColor", Color); } if (!Highlight.Equals(Transparent) && !Highlight.Equals(Automatic)) { writer.WriteAttributeString("highlightColor", Highlight); } writer.WriteAttributeString("fontSize", FontSize); if (IsBold) { writer.WriteAttributeString("bold", IsBold.ToString().ToLower()); } if (IsItalic) { writer.WriteAttributeString("italic", IsItalic.ToString().ToLower()); } if (IsUnderline) { writer.WriteAttributeString("underline", IsUnderline.ToString().ToLower()); } if (IsStrikethrough) { writer.WriteAttributeString("strikethrough", IsStrikethrough.ToString().ToLower()); } if (IsSuperscript) { writer.WriteAttributeString("superscript", IsSuperscript.ToString().ToLower()); } if (IsSubscript) { writer.WriteAttributeString("subscript", IsSubscript.ToString().ToLower()); } writer.WriteAttributeString("spaceBefore", SpaceBefore); writer.WriteAttributeString("spaceAfter", SpaceAfter); writer.WriteAttributeString("spacing", Spacing); }
public void Save() { string[] values = new string[17]; values[0] = name; values[1] = imagePath; values[2] = anchor.ToString(); values[3] = increment.ToString(); values[4] = xPos.ToString(); values[5] = yPos.ToString(); values[6] = lastUsed.ToString(); values[7] = FontName; values[8] = FontSize.ToString(); values[9] = IsBold.ToString(); values[10] = IsCursive.ToString(); values[11] = FontColor.ToArgb().ToString(); values[12] = BorderSize.ToString(); values[13] = BorderColor.ToArgb().ToString(); DataHelper.SaveData(values, name); }