public RunText AddText(string text) { var runText = RunText.Create(text); Xml.Add(runText.Xml); return(runText); }
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) }; })); }