Class Element
Represents an element in the application.
Inheritance
Inherited Members
Namespace: DataWeb.Structure
Assembly: DataWeb.Core.dll
Syntax
public class Element
Constructors
Element(IAuthorizationService, IAreaStore, IElementStore, ISectionStore, IViewStore)
Initializes a new instance of the Element class with the specified dependencies.
Declaration
public Element(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
IdMaster
Gets or sets the unique identifier.
Declaration
public string IdMaster { get; set; }
Property Value
Type |
---|
string |
IsCompleted
Whether the element is completed.
Declaration
public bool IsCompleted { get; set; }
Property Value
Type |
---|
bool |
Name
The name of the element.
Declaration
public string Name { get; set; }
Property Value
Type |
---|
string |
Status
The status of the element.
Declaration
public ItemStatus Status { get; set; }
Property Value
Type |
---|
ItemStatus |
Title
The title of the element.
Declaration
public string Title { get; set; }
Property Value
Type |
---|
string |
Methods
GetAllSectionsAsync()
Asynchronously retrieves all sections associated with the element.
Declaration
public Task<IEnumerable<Section>> GetAllSectionsAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<Section>> | An enumerable of sections associated with the element. |
GetUserSectionsAsync(IUser)
Asynchronously retrieves the sections associated with the element that the specified user has permission to see.
Declaration
public Task<IEnumerable<Section>> GetUserSectionsAsync(IUser user)
Parameters
Type | Name | Description |
---|---|---|
IUser | user | The IUser for which to retrieve sections. |
Returns
Type | Description |
---|---|
Task<IEnumerable<Section>> | An enumerable of sections the specified user has permission to see. |
Init(ElementData)
Initializes the element with the specified data.
Declaration
public void Init(ElementData elementData)
Parameters
Type | Name | Description |
---|---|---|
ElementData | elementData | The ElementData to use to initialize the element. |
InitAsync(string)
Asynchronously initializes the element with the specified name.
Declaration
public Task InitAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the element to initialize. |
Returns
Type | Description |
---|---|
Task |