Class Section
Represents a section of an application.
Inheritance
Inherited Members
Namespace: DataWeb.Structure
Assembly: DataWeb.Core.dll
Syntax
public class Section
Constructors
Section(IAuthorizationService, IAreaStore, IElementStore, ISectionStore, IViewStore)
Initializes a new instance of the Section class.
Declaration
public Section(IAuthorizationService authorizationService, IAreaStore areaStore, IElementStore elementStore, ISectionStore sectionStore, IViewStore viewStore)
Parameters
Type | Name | Description |
---|---|---|
IAuthorizationService | authorizationService | The authorization service. |
IAreaStore | areaStore | The area store. |
IElementStore | elementStore | The element store. |
ISectionStore | sectionStore | The section store. |
IViewStore | viewStore | The view store. |
Properties
Color
Gets or sets the color of the section.
Declaration
public string Color { get; set; }
Property Value
Type |
---|
string |
IdMaster
Gets or sets the unique identifier.
Declaration
public string IdMaster { get; set; }
Property Value
Type |
---|
string |
IdMasterStep
Gets or sets the IdMaster of the section step.
Declaration
public string IdMasterStep { get; set; }
Property Value
Type |
---|
string |
IsCompleted
Gets or sets a value indicating whether the section is completed.
Declaration
public bool IsCompleted { get; set; }
Property Value
Type |
---|
bool |
Module
Gets or sets the module of the section.
Declaration
public string Module { get; set; }
Property Value
Type |
---|
string |
ModuleClass
Gets or sets the module class of the section.
Declaration
public string ModuleClass { get; set; }
Property Value
Type |
---|
string |
ModuleComponent
Gets or sets the module component of the section.
Declaration
public string ModuleComponent { get; set; }
Property Value
Type |
---|
string |
Name
Gets or sets the name of the section.
Declaration
public string Name { get; set; }
Property Value
Type |
---|
string |
PermissionSetName
Gets or sets the name of the permission set for the section.
Declaration
public string PermissionSetName { get; set; }
Property Value
Type |
---|
string |
Settings
Gets or sets the settings of the section.
Declaration
public Section.SectionSettings Settings { get; set; }
Property Value
Type |
---|
Section.SectionSettings |
Status
Gets or sets the status of the section.
Declaration
public ItemStatus Status { get; set; }
Property Value
Type |
---|
ItemStatus |
Title
Gets or sets the title of the section.
Declaration
public string Title { get; set; }
Property Value
Type |
---|
string |
Type
Gets or sets the type of the section.
Declaration
public string Type { get; set; }
Property Value
Type |
---|
string |
VisibleRoles
Gets or sets the list of roles that can see the section.
Declaration
public List<string> VisibleRoles { get; set; }
Property Value
Type |
---|
List<string> |
Methods
GetAllViewsAsync()
Get all views associated with the section.
Declaration
public Task<IEnumerable<View>> GetAllViewsAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<View>> | An enumerable of views associated with the section. |
GetElementAsync()
Gets the element associated with the section, if one exists.
Declaration
public Task<Element> GetElementAsync()
Returns
Type | Description |
---|---|
Task<Element> | The element associated with the section, or null if no element is associated. |
GetParentAreaAsync()
Gets the parent area of the section, if one exists.
Declaration
public Task<Area> GetParentAreaAsync()
Returns
Type | Description |
---|---|
Task<Area> | The parent area of the section, or null if the section is not part of an area. |
GetParentElementAsync()
Gets the parent element of the section, if one exists.
Declaration
public Task<Element> GetParentElementAsync()
Returns
Type | Description |
---|---|
Task<Element> | The parent element of the section, or null if the section is not part of an element. |
GetSettingValue(string)
Gets the value of the specified setting from the section's settings.
Declaration
public object GetSettingValue(string settingName)
Parameters
Type | Name | Description |
---|---|---|
string | settingName | The name of the setting. |
Returns
Type | Description |
---|---|
object | The value of the setting if it exists, otherwise null. |
GetUserViewsAsync(IUser)
Get the views associated with the section that the specified user is allowed to see.
Declaration
public Task<IEnumerable<View>> GetUserViewsAsync(IUser user)
Parameters
Type | Name | Description |
---|---|---|
IUser | user | The IUser for whom to get the views. |
Returns
Type | Description |
---|---|
Task<IEnumerable<View>> | An enumerable of views that the user is allowed to see. |
Init(SectionData)
Initializes the Section object with the specified SectionData object.
Declaration
public void Init(SectionData sectionData)
Parameters
Type | Name | Description |
---|---|---|
SectionData | sectionData | The SectionData object containing the section data. |
InitAsync(string)
Initializes the Section object with data from the section store for the specified section name.
Declaration
public Task InitAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the section. |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
System.Exception | Thrown when the section name is not defined or the section data could not be retrieved from the section store. |
IsVisible(PermissionSet)
Determines whether this section is visible to the given permission set.
Declaration
public bool IsVisible(PermissionSet permissionSet)
Parameters
Type | Name | Description |
---|---|---|
PermissionSet | permissionSet | The PermissionSet to check against. |
Returns
Type | Description |
---|---|
bool | True if the section is visible; false otherwise. |
IsVisibleDataField(DataField, IUser)
Determines whether the given data field is visible to the given user.
Declaration
public bool IsVisibleDataField(Section.DataField dataField, IUser user)
Parameters
Type | Name | Description |
---|---|---|
Section.DataField | dataField | The Section.DataField to check visibility for. |
IUser | user | The IUser to check visibility for. |
Returns
Type | Description |
---|---|
bool | True if the data field is visible; false otherwise. |
IsVisibleWidget(Widget, IUser)
Determines whether the given widget is visible to the given user.
Declaration
public bool IsVisibleWidget(Section.Widget widget, IUser user)
Parameters
Type | Name | Description |
---|---|---|
Section.Widget | widget | The Section.Widget to check visibility for. |
IUser | user | The IUser to check visibility for. |
Returns
Type | Description |
---|---|
bool | True if the widget is visible; false otherwise. |