Beispiel #1
0
 protected internal TagBase(string name, TagOptions options, object[] content) : this(name, options)
 {
     if (content?.Length > 0)
     {
         TagChildren.Replace(content);
     }
 }
Beispiel #2
0
 protected internal TagBase(string name, object content, TagOptions options = null)
     : this(name, options)
 {
     if (content != null)
     {
         TagChildren.Replace(content);
     }
 }
Beispiel #3
0
 public Tag(string name, object content, TagOptions options = null)
     : this(name, options)
 {
     if (content != null)
     {
         TagChildren.Replace(content);
     }
 }
Beispiel #4
0
        /// <summary>
        /// Wrap the tag around the new content, so this replaces all the content with what you give it
        /// </summary>

        /// <param name="content">a variable amount of tags / strings to add to the contents of this tag</param>
        /// <returns></returns>
        public T Wrap(params object[] content)
        {
            TagChildren.Replace(content);
            return(this as T);
        }
Beispiel #5
0
        /// <summary>
        /// Wrap the tag around the new content, so this replaces all the content with what you give it
        /// </summary>

        /// <param name="content">New content - can be a string, TagBase or list of tags</param>
        /// <returns></returns>
        public T Wrap(object content)
        {
            TagChildren.Replace(content);
            return(this as T);
        }
Beispiel #6
0
        /// <summary>
        /// Add contents to this tag - at the end of the already added contents.
        /// If you want to replace the contents, use Wrap() instead
        /// </summary>

        /// <param name="children">a variable amount of tags / strings to add to the contents of this tag</param>
        /// <returns></returns>
        public T Add(params object[] children)
        {
            TagChildren.Add(children);
            return(this as T);
        }
Beispiel #7
0
        /// <summary>
        /// Add contents to this tag - at the end of the already added contents.
        /// If you want to replace the contents, use Wrap() instead
        /// </summary>

        /// <param name="child"></param>
        /// <returns></returns>
        public T Add(object child)
        {
            TagChildren.Add(child);
            return(this as T);
        }