Class FormItemExtensions
Contains extension methods for form items.
public static class FormItemExtensions
- Inheritance
-
objectFormItemExtensions
Methods
GetClientProperties(IEnumerable<IFormItem>)
Invokes GetClientProperties() method on each item in formItems
collection.
public static Task<ICollection<IFormItemClientProperties>> GetClientProperties(this IEnumerable<IFormItem> formItems)
Parameters
formItems
IEnumerable<IFormItem>Form items collection.
Returns
- Task<ICollection<IFormItemClientProperties>>
IsValid(IFormItem)
Returns true if all validation rules of component item
have their IsValid flag set to true.
public static bool IsValid(this IFormItem item)
Parameters
item
IFormItemComponent item whose validation rules to examine.
Returns
- bool
Returns true if all validation rules have their validity flag set to true, otherwise returns false.
Remarks
FormCategory is always considered valid.
Exceptions
- ArgumentNullException
Thrown when
item
is null.
IsValid(IEnumerable<IFormItem>)
Returns true if all validation rules of items
have their IsValid flag set to true.
public static bool IsValid(this IEnumerable<IFormItem> items)
Parameters
items
IEnumerable<IFormItem>Items whose validation rules to examine.
Returns
- bool
Returns true if all validation rules have their validity flag set to true, otherwise returns false.
Exceptions
- ArgumentNullException
Thrown when
items
is null.
IsVisible(IFormItem)
Returns true if all visibility conditions of component item
have their IsVisible flag set to true.
public static bool IsVisible(this IFormItem item)
Parameters
item
IFormItemComponent item whose visibility conditions to examine.
Returns
- bool
Returns true if all visibility conditions have their visibility flag set to true, otherwise returns false.
Remarks
FormCategory is always considered visible.
Exceptions
- ArgumentNullException
Thrown when
item
is null.
OnlyVisible(IEnumerable<IFormItem>)
Filters an enumeration of form items and returns only the items which are visible.
public static IEnumerable<IFormItem> OnlyVisible(this IEnumerable<IFormItem> items)
Parameters
items
IEnumerable<IFormItem>Items to filter.
Returns
- IEnumerable<IFormItem>
Returns enumeration containing the visible components only.
Exceptions
- ArgumentNullException
Thrown when
items
is null.