Пример #1
0
 public static void WriteStyle(XmlWriter writer, string name, int key, string className = null, Color?foreGround = null, Color?background = null, bool eolFilled = false, bool bold = false)
 {
     writer.WriteStartElement("style");
     writer.WriteAttributeString("name", name);
     writer.WriteAttributeString("key", key.ToString());
     if (className != null)
     {
         writer.WriteAttributeString("class", className);
     }
     if (foreGround.HasValue)
     {
         writer.WriteAttributeString("fore", HighlightingHelper.GetRPGString(foreGround.Value));
     }
     if (background.HasValue)
     {
         writer.WriteAttributeString("back", HighlightingHelper.GetRPGString(background.Value));
     }
     if (eolFilled)
     {
         writer.WriteAttributeString("eolfilled", eolFilled.ToString().ToLower());
     }
     if (bold)
     {
         writer.WriteAttributeString("bold", bold.ToString().ToLower());
     }
     writer.WriteEndElement();
 }
Пример #2
0
 public static void WriteStyle(XmlWriter writer, string name, int styleID, Color fgColor, Color bgColor, string fontName, int fontStyle, int?fontSize)
 {
     writer.WriteStartElement("WordsStyle");
     writer.WriteAttributeString("name", name);
     writer.WriteAttributeString("styleID", styleID.ToString());
     writer.WriteAttributeString("fgColor", HighlightingHelper.GetRPGString(fgColor));
     writer.WriteAttributeString("bgColor", HighlightingHelper.GetRPGString(bgColor));
     writer.WriteAttributeString("fontName", fontName);
     writer.WriteAttributeString("fontStyle", fontStyle.ToString());
     if (fontSize.HasValue)
     {
         writer.WriteAttributeString("fontSize", fontSize.Value.ToString());
     }
     writer.WriteEndElement();
 }