rendering optimizations
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user