internal EwfTableCell( TableCellSetup setup, IEnumerable<Control> controls ) { Setup = setup; Controls = controls.Any() ? controls : "".GetLiteralControl().ToSingleElementArray(); simpleText = null; setObsoleteProperties(); }
internal EwfTableCell( TableCellSetup setup, string text ) { Setup = setup; Controls = ( text ?? "" ).GetLiteralControl().ToSingleElementArray(); simpleText = text; setObsoleteProperties(); }
internal EwfTableCell(TableCellSetup setup, IEnumerable <Control> controls) { Setup = setup; Controls = controls.ToImmutableArray(); Controls = Controls.Any() ? Controls : "".ToComponents().GetControls().ToImmutableArray(); simpleText = null; }
internal EwfTableCell(TableCellSetup setup, Control control) : this(setup, control != null ? control.ToCollection() : new Control[0]) { }
internal EwfTableCell(TableCellSetup setup, string text) { Setup = setup; Controls = (text ?? "").ToComponents().GetControls().ToImmutableArray(); simpleText = text; }
/// <summary> /// Creates a table cell containing these controls. If no controls exist, the cell will contain a non-breaking space. /// </summary> public static EwfTableCell ToCell(this IEnumerable <Control> controls, TableCellSetup setup = null) { return(new EwfTableCell(setup ?? new TableCellSetup(), controls)); }
/// <summary> /// Creates a table cell containing this control. If the control is null, the cell will contain a non-breaking space. If you don't need to pass a setup /// object, don't use this method; controls are implicitly converted to table cells. /// </summary> public static EwfTableCell ToCell(this Control control, TableCellSetup setup) { return(new EwfTableCell(setup, control)); }
/// <summary> /// Creates a table cell containing an HTML-encoded version of this string. If the string is empty, the cell will contain a non-breaking space. If you don't /// need to pass a setup object, don't use this method; strings are implicitly converted to table cells. /// </summary> public static EwfTableCell ToCell(this string text, TableCellSetup setup) { return(new EwfTableCell(setup, text)); }
/// <summary> /// Creates a table cell containing components that represent this string. Do not call on null. /// </summary> /// <param name="text"></param> /// <param name="setup"></param> public static EwfTableCell ToCell(this string text, TableCellSetup setup = null) => // Remove null handling when we’re confident it won’t break too many things. new EwfTableCell(setup ?? new TableCellSetup(), (text ?? "").ToComponents(), simpleText: text ?? "");
/// <summary> /// Creates a table cell containing this component. If called on null, creates an empty cell. /// </summary> /// <param name="content"></param> /// <param name="setup"></param> public static EwfTableCell ToCell(this FlowComponent content, TableCellSetup setup = null) => (content?.ToCollection()).ToCell(setup: setup);
/// <summary> /// Creates a table cell containing these components. If called on null, creates an empty cell. /// </summary> /// <param name="content"></param> /// <param name="setup"></param> public static EwfTableCell ToCell(this IReadOnlyCollection <FlowComponent> content, TableCellSetup setup = null) => new EwfTableCell(setup ?? new TableCellSetup(), content);
internal EwfTableCell(TableCellSetup setup, IReadOnlyCollection <FlowComponent> content, string simpleText = null) { Setup = setup; Content = content; this.simpleText = simpleText; }
internal EwfTableCell( TableCellSetup setup, Control control ) : this(setup, control != null ? control.ToSingleElementArray() : new Control[ 0 ]) { }
internal EwfTableCell(TableCellSetup setup, IEnumerable <Control> controls) { Setup = setup; Controls = controls.Any() ? controls : "".GetLiteralControl().ToSingleElementArray(); simpleText = null; }
internal EwfTableCell(TableCellSetup setup, Control control) : this(setup, control != null ? control.ToSingleElementArray() : new Control[0]) { }
internal EwfTableCell(TableCellSetup setup, string text) { Setup = setup; Controls = (text ?? "").GetLiteralControl().ToSingleElementArray(); simpleText = text; }