Class Element
Represents an element in the application.
Inherited Members
Namespace: DataWeb.Structure
Assembly: DataWeb.Core.dll
Syntax
public sealed class Element
Remarks
Initializes a new instance of the Element class with the specified dependencies.
Constructors
Element(IReflectionService, IAppErrorService, IAuthorizationService, IAreaStore, IElementStore, ISectionStore, IViewStore, IServiceProvider)
Represents an element in the application.
Declaration
public Element(IReflectionService reflectionService, IAppErrorService appErrorService, IAuthorizationService authorizationService, IAreaStore areaStore, IElementStore elementStore, ISectionStore sectionStore, IViewStore viewStore, IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
IReflectionService | reflectionService | The IReflectionService instance used for reflection operations. |
IAppErrorService | appErrorService | The IAppErrorService instance used for error handling. |
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. |
IServiceProvider | serviceProvider | The IServiceProvider instance used for dependency injection. |
Remarks
Initializes a new instance of the Element class with the specified dependencies.
Properties
IdMaster
Gets or sets the unique identifier.
Declaration
public string IdMaster { get; set; }
Property Value
Type | Description |
---|---|
string |
IsCompleted
Whether the element is completed.
Declaration
public bool IsCompleted { get; set; }
Property Value
Type | Description |
---|---|
bool |
Name
The name of the element.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
Status
The status of the element.
Declaration
public ItemStatus Status { get; set; }
Property Value
Type | Description |
---|---|
ItemStatus |
Title
The title of the element.
Declaration
public string Title { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
GetAllSectionsAsync(CancellationToken)
Asynchronously retrieves all sections associated with the element.
Declaration
public Task<IEnumerable<Section>> GetAllSectionsAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<Section>> | An enumerable of sections associated with the element. |
GetUserSectionsAsync(IUser, CancellationToken)
Asynchronously retrieves the sections associated with the element that the specified user has permission to see.
Declaration
public Task<IEnumerable<Section>> GetUserSectionsAsync(IUser user, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IUser | user | The IUser for which to retrieve sections. |
CancellationToken | cancellationToken |
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, CancellationToken)
Asynchronously initializes the element with the specified name.
Declaration
public Task InitAsync(string name, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the element to initialize. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |