public TextBreak AddBreak(TextBreakType textBreakType = TextBreakType.TextWrapping, TextBreakClear textBreakClear = TextBreakClear.None) { var br = TextBreak.Create(textBreakType, textBreakClear); Xml.Add(br.Xml); return(br); }
public void AppendTextBreak(TextBreakType type = TextBreakType.TextWrapping, TextBreakClear clear = TextBreakClear.None) { var br = TextBreak.Create(type, clear); var run = new XElement(XName.Get("r", Namespaces.w.NamespaceName), br.Xml); // TODO: Should append to the last run here Xml.Add(run); }
private static IEnumerable <RunContentElementBase> BuildContent(string text) { if (text == null) { throw new ArgumentNullException(nameof(text)); } var parts = splitRegex.Split(text); return(parts.Select <string, RunContentElementBase>(part => { return part switch { "\n" => TextBreak.Create(), "\t" => Tab.Create(), "\u00AD" => SoftHyphen.Create(), "\u2011" => NoBreakHyphen.Create(), _ => RunText.Create(part) }; })); }