コード例 #1
0
 static Text SetText(string value, SpaceProcessingModeValues modelValue = SpaceProcessingModeValues.Preserve)
 {
     return(new Text(value)
     {
         Space = modelValue
     });
 }
コード例 #2
0
 public static PlatformText New(string text, SpaceProcessingModeValues preserveSpaces)
 {
     return(new PlatformText(new Text(text)
     {
         Space = preserveSpaces.ToOOxml()
     }));
 }
コード例 #3
0
        /// <summary>
        /// Add text to paragraph
        /// </summary>
        /// <param name="content"> Text </param>
        /// <param name="space"> Space style </param>
        /// <param name="rpr"> Run properties </param>
        public void AddTextToParagraph(Paragraph paragraph, string content, SpaceProcessingModeValues space = SpaceProcessingModeValues.Default, RunProperties rpr = null)
        {
            Run r = new Run();

            // Always add properties first
            r.Append(rpr);
            Text t = new Text(content)
            {
                Space = space
            };

            r.Append(t);
            paragraph.Append(r);
        }
コード例 #4
0
    public OpenXmlCompositeElement NewRun(OpenXmlCompositeElement?runProps, string?text, SpaceProcessingModeValues spaceMode, bool initialBr)
    {
        var textNode = new W.Text(text !)
        {
            Space = spaceMode
        };

        var result = new W.Run(runProps !, textNode);

        if (initialBr)
        {
            result.InsertBefore(new W.Break(), textNode);
        }

        return(result);
    }
コード例 #5
0
 public static DocumentFormat.OpenXml.EnumValue <DocumentFormat.OpenXml.SpaceProcessingModeValues> ToOOxml(this SpaceProcessingModeValues value)
 {
     return((DocumentFormat.OpenXml.SpaceProcessingModeValues)(int) value);
 }
コード例 #6
0
 public OpenXmlCompositeElement NewRun(OpenXmlCompositeElement runProps, string text, SpaceProcessingModeValues spaceMode)
 {
     return(new D.Run(runProps, new D.Text(text)));
 }