protected internal TagBase(string name, TagOptions options, object[] content) : this(name, options) { if (content?.Length > 0) { TagChildren.Replace(content); } }
protected internal TagBase(string name, object content, TagOptions options = null) : this(name, options) { if (content != null) { TagChildren.Replace(content); } }
public Tag(string name, object content, TagOptions options = null) : this(name, options) { if (content != null) { TagChildren.Replace(content); } }
/// <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); }
/// <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); }
/// <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); }
/// <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); }