Class Area
Represents an area in the application.
Inheritance
Inherited Members
Namespace: DataWeb.Structure
Assembly: DataWeb.Core.dll
Syntax
public class Area
Constructors
Area(IAuthorizationService, IAreaStore, IElementStore, ISectionStore, IViewStore)
Initializes a new instance of the Area class with the specified dependencies.
Declaration
public Area(IAuthorizationService authorizationService, IAreaStore areaStore, IElementStore elementStore, ISectionStore sectionStore, IViewStore viewStore)
Parameters
Type | Name | Description |
---|---|---|
IAuthorizationService | authorizationService | The authorization service used to check permissions. |
IAreaStore | areaStore | The store used to access area data. |
IElementStore | elementStore | The store used to access element data. |
ISectionStore | sectionStore | The store used to access section data. |
IViewStore | viewStore | The store used to access view data. |
Properties
Color
The color associated with the area.
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 |
IsCompleted
Whether the area is completed.
Declaration
public bool IsCompleted { get; set; }
Property Value
Type |
---|
bool |
Name
The name of the area.
Declaration
public string Name { get; set; }
Property Value
Type |
---|
string |
Navigation
The navigation associated with the area.
Declaration
public Navigation Navigation { get; set; }
Property Value
Type |
---|
Navigation |
Status
The status of the area.
Declaration
public ItemStatus Status { get; set; }
Property Value
Type |
---|
ItemStatus |
Title
The title of the area.
Declaration
public string Title { get; set; }
Property Value
Type |
---|
string |
Type
The type of the area.
Declaration
public string Type { get; set; }
Property Value
Type |
---|
string |
VisibleRoles
The roles that can view the area.
Declaration
public List<string> VisibleRoles { get; set; }
Property Value
Type |
---|
List<string> |
Methods
GetAllSectionsAsync()
Asynchronously retrieves all the sections in the area.
Declaration
public Task<IEnumerable<Section>> GetAllSectionsAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<Section>> | An enumerable of sections in the area. |
GetUserSectionsAsync(IUser)
Asynchronously retrieves the sections in the area that are visible to the specified user.
Declaration
public Task<IEnumerable<Section>> GetUserSectionsAsync(IUser user)
Parameters
Type | Name | Description |
---|---|---|
IUser | user | The IUser for which to retrieve the visible sections. |
Returns
Type | Description |
---|---|
Task<IEnumerable<Section>> | An enumerable of the visible sections. |
Init(AreaData)
Initializes the area with the specified data.
Declaration
public void Init(AreaData areaData)
Parameters
Type | Name | Description |
---|---|---|
AreaData | areaData | The AreaData used to initialize the area. |
InitAsync(string)
Initializes the area asynchronously with the specified name.
Declaration
public Task InitAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the area. |
Returns
Type | Description |
---|---|
Task |
IsVisible(PermissionSet)
Determines whether the area is visible to a user with the specified permission set.
Declaration
public bool IsVisible(PermissionSet permissionSet)
Parameters
Type | Name | Description |
---|---|---|
PermissionSet | permissionSet | The PermissionSet of the user. |
Returns
Type | Description |
---|---|
bool | True if the area is visible; false otherwise. |