示例#1
0
        public RunText AddText(string text)
        {
            var runText = RunText.Create(text);

            Xml.Add(runText.Xml);
            return(runText);
        }
示例#2
0
        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)
                };
            }));
        }