private static string BeginInstructions(TextWriter writer, OpenXmlRunPropertiesModel properties)
        {
            StringBuilder stringBuilder = new StringBuilder();

            using (StringWriter q = new StringWriter(stringBuilder, CultureInfo.InvariantCulture))
            {
                properties.Write(q);
            }
            string text = stringBuilder.ToString();

            writer.Write("<w:r>");
            writer.Write(text);
            writer.Write("<w:fldChar w:fldCharType=\"begin\" w:fldLock=\"0\" w:dirty=\"0\"/></w:r><w:r>");
            properties.NoProof = true;
            properties.Write(writer);
            properties.NoProof = false;
            return(text);
        }
Exemplo n.º 2
0
 public void Write(TextWriter writer)
 {
     writer.Write("<w:r>");
     _properties.Write(writer);
     if (_startsWithBreak)
     {
         writer.Write("<w:br/>");
     }
     if (!string.IsNullOrEmpty(_text))
     {
         writer.Write("<w:t xml:space=\"preserve\">");
         writer.Write(_text);
         writer.Write("</w:t>");
     }
     writer.Write("</w:r>");
 }