component rendering optimizations
This commit is contained in:
@ -95,7 +95,7 @@ else
|
||||
|
||||
if (authorized)
|
||||
{
|
||||
CreateComponent(builder, module);
|
||||
CreateComponent(builder, module, module.PageModuleId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -106,7 +106,7 @@ else
|
||||
// check if user is authorized to view module
|
||||
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.PermissionList))
|
||||
{
|
||||
CreateComponent(builder, module);
|
||||
CreateComponent(builder, module, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -115,11 +115,14 @@ else
|
||||
};
|
||||
}
|
||||
|
||||
private void CreateComponent(RenderTreeBuilder builder, Module module)
|
||||
private void CreateComponent(RenderTreeBuilder builder, Module module, int key)
|
||||
{
|
||||
builder.OpenComponent(0, Type.GetType(Constants.ContainerComponent));
|
||||
builder.AddAttribute(1, "ModuleState", module);
|
||||
builder.SetKey(module.PageModuleId);
|
||||
if (key != -1)
|
||||
{
|
||||
builder.SetKey(module.PageModuleId);
|
||||
}
|
||||
builder.CloseComponent();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user