示例#1
0
        /**
         * Appends a component to the builder and makes it the current target for
         * formatting. You can specify the amount of formatting retained from
         * previous part.
         *
         * @param component the component to append
         * @param retention the formatting to retain
         * @return this ComponentBuilder for chaining
         */
        public ComponentBuilder Append(BaseComponent component, FormatRetention retention)
        {
            _parts.Add(_current);

            BaseComponent previous = _current;

            _current = component.Duplicate();
            _current.CopyFormatting(previous, retention, false);
            return(this);
        }
示例#2
0
 /**
  * Creates a ComponentBuilder with the given component as the first part.
  *
  * @param component the first component element
  */
 public ComponentBuilder(BaseComponent component)
 {
     _current = component.Duplicate();
 }