Class Form
Represents a form that contains a list of ControlBase objects.
Inheritance
Inherited Members
Namespace: DataWeb.Data
Assembly: DataWeb.Core.dll
Syntax
public class Form
Constructors
Form(IReflectionService, IAppErrorService, IFormStore, IServiceProvider)
Initializes a new instance of the Form class with the specified dependencies.
Declaration
public Form(IReflectionService reflectionService, IAppErrorService appErrorService, IFormStore formStore, IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
IReflectionService | reflectionService | The IReflectionService instance used for reflection operations. |
IAppErrorService | appErrorService | The IAppErrorService instance used for error handling. |
IFormStore | formStore | The IFormStore instance used for storing and retrieving forms. |
IServiceProvider | serviceProvider | The IServiceProvider instance used for dependency injection. |
Properties
Controls
Gets or sets the list of controls that belong to the form.
Declaration
public List<ControlBase> Controls { get; set; }
Property Value
Type |
---|
List<ControlBase> |
IdMaster
Gets or sets the unique identifier.
Declaration
public string IdMaster { get; set; }
Property Value
Type |
---|
string |
Name
Gets or sets the name of the form.
Declaration
public string Name { get; set; }
Property Value
Type |
---|
string |
Methods
InitAsync(FormData)
Initializes the Form object with the specified FormData object.
Declaration
public Task InitAsync(FormData formData)
Parameters
Type | Name | Description |
---|---|---|
FormData | formData | The FormData object. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
InitAsync(string, string)
Initializes the Form object with the specified name and culture.
Declaration
public Task InitAsync(string name, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the form. |
string | culture | The culture of the form. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
Exceptions
Type | Condition |
---|---|
System.Exception | Thrown when name or culture is null or empty. |
IsUserControl(ControlBase, IUser)
Checks whether the specified ControlBase object is visible to the specified IUser object.
Declaration
public bool IsUserControl(ControlBase control, IUser user)
Parameters
Type | Name | Description |
---|---|---|
ControlBase | control | The ControlBase object. |
IUser | user | The IUser object. |
Returns
Type | Description |
---|---|
bool | True if the control is visible to the user; otherwise false. |
SetControlAsync(ControlData)
Creates a new ControlBase object based on the specified ControlData object.
Declaration
public Task<ControlBase> SetControlAsync(ControlData controlData)
Parameters
Type | Name | Description |
---|---|---|
ControlData | controlData | The ControlData object. |
Returns
Type | Description |
---|---|
Task<ControlBase> | A new ControlBase object. |
SetControlEvents(ControlBase, ProvidedValue)
Sets the events for the specified ControlBase object based on the specified ProvidedValue object.
Declaration
public void SetControlEvents(ControlBase control, Form.ProvidedValue providedValue)
Parameters
Type | Name | Description |
---|---|---|
ControlBase | control | The ControlBase object. |
Form.ProvidedValue | providedValue | The Form.ProvidedValue object. |