rendering optimizations

This commit is contained in:
sbwalker
2025-06-05 09:31:54 -04:00
parent 985e50d415
commit 4418e27c29
9 changed files with 74 additions and 33 deletions

View File

@ -29,7 +29,7 @@ else
RenderFragment DynamicComponent { get; set; }
protected override void OnParametersSet()
{
{
if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.PermissionList) && PageState.Action == Constants.DefaultAction)
{
_useadminborder = true;
@ -45,12 +45,6 @@ else
{
foreach (Module module in PageState.Modules)
{
// set renderid - this allows the framework to determine which components should be rendered when PageState changes
if (module.RenderId != PageState.RenderId)
{
module.RenderId = PageState.RenderId;
}
var pane = module.Pane;
if (module.ModuleId == PageState.ModuleId && PageState.Action != Constants.DefaultAction)
{
@ -101,7 +95,7 @@ else
if (authorized)
{
CreateComponent(builder, module, module.PageModuleId);
CreateComponent(builder, module);
}
}
}
@ -112,7 +106,7 @@ else
// check if user is authorized to view module
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.PermissionList))
{
CreateComponent(builder, module, -1);
CreateComponent(builder, module);
}
}
}
@ -121,14 +115,11 @@ else
};
}
private void CreateComponent(RenderTreeBuilder builder, Module module, int key)
private void CreateComponent(RenderTreeBuilder builder, Module module)
{
builder.OpenComponent(0, typeof(ContainerBuilder));
builder.AddAttribute(1, "ModuleState", module);
if (key != -1)
{
builder.SetKey(module.PageModuleId);
}
builder.SetKey(module.PageModuleId);
builder.CloseComponent();
}
}