private static (string formControlType, string formControlName) GetFormControlDescription([NotNull] ICell cell) { var formControlDescription = TemplateDescriptionHelper.TryGetFormControlFromValueDescription(cell.StringValue); if (string.IsNullOrEmpty(formControlDescription.formControlType) || formControlDescription.formControlName == null) { throw new InvalidOperationException($"Invalid xlsx template. '{cell.StringValue}' is not a valid form control description."); } return(formControlDescription); }
private void RenderFormControl(ITableBuilder tableBuilder, object model, ICell cell) { var childModel = StrictExtractChildModel(model, cell); if (childModel != null) { var(controlType, controlName) = TemplateDescriptionHelper.TryGetFormControlFromValueDescription(cell.StringValue); var renderer = rendererCollection.GetFormControlRenderer(controlType, childModel.GetType()); renderer.Render(tableBuilder, controlName, childModel); } tableBuilder.SetCurrentStyle(); tableBuilder.MoveToNextColumn(); }