Class ElementFieldList
- Namespace
- JJMasterData.Commons.Data.Entity.Models
- Assembly
- JJMasterData.Commons.dll
Represents a collection of ElementField objects with additional utility methods for field management.
public class ElementFieldList : IList<ElementField>, ICollection<ElementField>, IEnumerable<ElementField>, IEnumerable
- Inheritance
-
ElementFieldList
- Implements
- Inherited Members
- Extension Methods
Remarks
Originally created by JJTeam on 2017-03-22.
Constructors
ElementFieldList()
public ElementFieldList()
ElementFieldList(List<ElementField>)
Initializes a new instance of the ElementFieldList class with an existing list of fields.
public ElementFieldList(List<ElementField> fields)
Parameters
fields
List<ElementField>A list of ElementField objects to initialize the collection.
Properties
Count
public int Count { get; }
Property Value
IsReadOnly
public bool IsReadOnly { get; }
Property Value
this[int]
public ElementField this[int index] { get; set; }
Parameters
index
int
Property Value
this[string]
public ElementField this[string fieldName] { get; set; }
Parameters
fieldName
string
Property Value
Methods
Add(ElementField)
Adds a new field to the collection.
public void Add(ElementField item)
Parameters
item
ElementFieldThe ElementField object to add.
Exceptions
- ArgumentException
Thrown if the item is null or already exists in the collection.
Add(string, string, FieldType, int, bool, FilterMode)
Adds a new field with the specified properties.
public void Add(string name, string label, FieldType dataType, int size, bool required, FilterMode filterMode)
Parameters
name
stringThe field name.
label
stringThe label or description.
dataType
FieldTypeThe data type of the field.
size
intThe size of the field.
required
boolIndicates whether the field is required.
filterMode
FilterModeThe filter mode of the field.
Add(string, string, FieldType, int, bool, FilterMode, FieldBehavior)
Adds a new field with the specified properties.
public void Add(string name, string label, FieldType dataType, int size, bool required, FilterMode filterMode, FieldBehavior dataBehavior)
Parameters
name
stringThe field name.
label
stringThe label or description.
dataType
FieldTypeThe data type of the field.
size
intThe size of the field.
required
boolIndicates whether the field is required.
filterMode
FilterModeThe filter mode of the field.
dataBehavior
FieldBehaviorSpecifies the behavior of the field.
AddPk(string, string, FieldType, int, bool, FilterMode)
Adds a new primary key field.
public void AddPk(string name, string label, FieldType dataType, int size, bool autoNum, FilterMode filterMode)
Parameters
name
stringThe primary key field name.
label
stringThe label or description.
dataType
FieldTypeThe data type of the field.
size
intThe size of the field.
autoNum
boolIndicates whether the field is auto-incremented.
filterMode
FilterModeThe filter mode of the field.
AddRange(IEnumerable<ElementField>)
public void AddRange(IEnumerable<ElementField> fields)
Parameters
fields
IEnumerable<ElementField>
Clear()
public void Clear()
Contains(ElementField)
public bool Contains(ElementField item)
Parameters
item
ElementField
Returns
ContainsKey(string)
Determines whether a field with the specified name exists in the list.
public bool ContainsKey(string name)
Parameters
name
stringThe name of the field to locate.
Returns
- bool
true
if a field with the specified name exists; otherwise,false
.
CopyTo(ElementField[], int)
public void CopyTo(ElementField[] array, int arrayIndex)
Parameters
array
ElementField[]arrayIndex
int
DeepCopy()
public ElementFieldList DeepCopy()
Returns
FindAll(Predicate<ElementField>)
public List<ElementField> FindAll(Predicate<ElementField> predicate)
Parameters
predicate
Predicate<ElementField>
Returns
GetAsList()
public List<ElementField> GetAsList()
Returns
GetEnumerator()
public IEnumerator<ElementField> GetEnumerator()
Returns
IndexOf(ElementField)
public int IndexOf(ElementField item)
Parameters
item
ElementField
Returns
Insert(int, ElementField)
public void Insert(int index, ElementField item)
Parameters
index
intitem
ElementField
Remove(ElementField)
public bool Remove(ElementField item)
Parameters
item
ElementField
Returns
RemoveAt(int)
public void RemoveAt(int index)
Parameters
index
int