Exemple #1
0
        /// <summary>
        /// A text formatting.
        /// </summary>
        public Formatting()
        {
            capsStyle      = CapsStyle.none;
            strikethrough  = StrikeThrough.none;
            script         = Script.none;
            highlight      = Highlight.none;
            underlineStyle = UnderlineStyle.none;
            misc           = Misc.none;

            rPr = new XElement(XName.Get("rPr", DocX.w.NamespaceName));
        }
Exemple #2
0
        /// <summary>
        /// A text formatting.
        /// </summary>
        public Formatting()
        {
            capsStyle = CapsStyle.none;
            strikethrough = StrikeThrough.none;
            script = Script.none;
            highlight = Highlight.none;
            underlineStyle = UnderlineStyle.none;
            misc = Misc.none;

            rPr = new XElement(XName.Get("rPr", DocX.w.NamespaceName));
        }
Exemple #3
0
        /// <summary>
        /// A text formatting.
        /// </summary>
        public Formatting()
        {
            capsStyle      = CapsStyle.none;
            strikethrough  = StrikeThrough.none;
            script         = Script.none;
            highlight      = Highlight.none;
            underlineStyle = UnderlineStyle.none;
            misc           = Misc.none;

            // Use current culture by default
            language = CultureInfo.CurrentCulture;

            rPr = new XElement(XName.Get("rPr", DocX.w.NamespaceName));
        }
        /// <summary>
        /// A text formatting.
        /// </summary>
        public Formatting()
        {
            capsStyle = CapsStyle.none;
            strikethrough = StrikeThrough.none;
            script = Script.none;
            highlight = Highlight.none;
            underlineStyle = UnderlineStyle.none;
            misc = Misc.none;

            // Use current culture by default
            language = CultureInfo.CurrentCulture;

            rPr = new XElement(XName.Get("rPr", DocX.w.NamespaceName));
        }
Exemple #5
0
        /// <summary>
        /// For use with Append() and AppendLine()
        /// </summary>
        /// <param name="capsStyle">The caps style to apply to the last appended text.</param>
        /// <returns>This Paragraph with the last appended text's caps style changed.</returns>
        /// <example>
        /// Append text to this Paragraph and then set it to full caps.
        /// <code>
        /// // Create a document.
        /// using (DocX document = DocX.Create(@"Test.docx"))
        /// {
        ///     // Insert a new Paragraph.
        ///     Paragraph p = document.InsertParagraph();
        ///
        ///     p.Append("I am ")
        ///     .Append("Capitalized").CapsStyle(CapsStyle.caps)
        ///     .Append(" I am not");
        ///        
        ///     // Save this document.
        ///     document.Save();
        /// }// Release this document from memory.
        /// </code>
        /// </example>
        public Paragraph CapsStyle(CapsStyle capsStyle)
        {
            switch (capsStyle)
            {
                case Novacode.CapsStyle.none:
                    break;

                default:
                    {
                        ApplyTextFormattingProperty(XName.Get(capsStyle.ToString(), DocX.w.NamespaceName), string.Empty, null);
                        break;
                    }
            }

            return this;
        }