using Microsoft.AspNetCore.Html;
using Util.Ui.Builders;
using Util.Ui.Configs;
using Util.Ui.Renders;
namespace Util.Ui.Tests.Samples {
///
/// 测试渲染器
///
public class TestRender : RenderBase {
///
/// 配置
///
private readonly Config _config;
///
/// 初始化测试渲染器
///
/// 配置
public TestRender( Config config ) {
_config = config;
}
///
/// 获取标签生成器
///
protected override TagBuilder GetTagBuilder() {
var builder = new TestBuilder(_config);
builder.Config();
builder.AttributeIfNotEmpty( UiConst.Name, _config.GetValue( UiConst.Name ) );
builder.AttributeIfNotEmpty( UiConst.Title, _config.GetValue( UiConst.Title ) );
return builder;
}
///
public override IHtmlContent Clone() {
return new TestRender( _config.Copy() );
}
}
}