Exemple #1
0
        public static Header AddHeader(this Document doc,
                                       HeaderLevel level, string text = "")
        {
            var ret = new Header(level, text);

            doc.SubElements.Add(ret);
            return(ret);
        }
Exemple #2
0
    // TODO: support for tables

    /// <summary>
    /// Creates a header from the specified text, with the specified level
    /// </summary>
    /// <param name="text">The header text</param>
    /// <param name="level">The header level</param>
    public static string Header(string text, HeaderLevel level = HeaderLevel.H1)
    {
        switch (level)
        {
        case HeaderLevel.H1: return(_H1 + text);

        case HeaderLevel.H2: return(_H2 + text);

        case HeaderLevel.H3: return(_H3 + text);

        case HeaderLevel.H4: return(_H4 + text);

        case HeaderLevel.H5: return(_H5 + text);

        case HeaderLevel.H6: return(_H6 + text);
        }
        throw new System.ArgumentException("The header level value '" + level + "' is invalid.");
    }
Exemple #3
0
 protected bool Equals(HeaderLevel other)
 {
     return(Equals(Value, other.Value));
 }
Exemple #4
0
 public Header(HeaderLevel level, string text)
 {
     Level = level;
     Text  = text;
 }