Interface IDataClassFieldsManager
- Namespace
- CMS.FormEngine
- Assembly
- CMS.FormEngine.dll
Implementing class should provide CRUD operations over data class fields.
public interface IDataClassFieldsManager
- Extension Methods
Methods
CreateField(string, FormFieldInfo)
Tries to create a new field with data from formField.
FieldValidationResult CreateField(string className, FormFieldInfo formField)
Parameters
classNamestringClass name or alternative form name of the form the field belongs to.
formFieldFormFieldInfoField containing the data of the new field.
Returns
- FieldValidationResult
Instance of FieldValidationResult, if the validation result is valid, new field was created. Otherwise it was not and validation result indicates why.
Exceptions
- ArgumentNullException
No field definition was provided.
- InvalidOperationException
The corresponding data class was not found.
DeleteField(string, string)
Tries to delete a field specified by fieldName
FieldValidationResult DeleteField(string className, string fieldName)
Parameters
classNamestringClass name or alternative form name of the form the field belongs to.
fieldNamestringName of the field to be deleted.
Returns
- FieldValidationResult
Instance of FieldValidationResult if the validation result is valid and the field was deleted. Otherwise, it is not deleted and the validation result indicates why.
Exceptions
- InvalidOperationException
The corresponding data class was not found.
MoveField(string, int, int)
Updates the form definition for the given className reordering it's fields.
void MoveField(string className, int sourceIndex, int destinationIndex)
Parameters
classNamestringClass name or alternative form name of the form the field belongs to.
sourceIndexintIndex of the field to be moved in the form fields collection.
destinationIndexintIndex where to move the field in the form fields collection.
Exceptions
- InvalidOperationException
Unknown
classNameprovided.- ArgumentOutOfRangeException
sourceIndexordestinationIndexare out of range of the form field collection of the class.
UpdateField(string, string, FormFieldInfo)
Tries to update a field given by fieldName with data from formField.
FieldValidationResult UpdateField(string className, string fieldName, FormFieldInfo formField)
Parameters
classNamestringClass name or alternative form name of the form the field belongs to.
fieldNamestringName of a field that is being updated.
formFieldFormFieldInfoField which contains updated data.
Returns
- FieldValidationResult
Instance of FieldValidationResult, if the validation result is valid, update was performed. Otherwise it was not and validation result indicates why.
Exceptions
- ArgumentNullException
No field definition provided.
- InvalidOperationException
Unknown
classNameorfieldNameprovided.