Table of Contents

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

int

IsReadOnly

public bool IsReadOnly { get; }

Property Value

bool

this[int]

public ElementField this[int index] { get; set; }

Parameters

index int

Property Value

ElementField

this[string]

public ElementField this[string fieldName] { get; set; }

Parameters

fieldName string

Property Value

ElementField

Methods

Add(ElementField)

Adds a new field to the collection.

public void Add(ElementField item)

Parameters

item ElementField

The 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 string

The field name.

label string

The label or description.

dataType FieldType

The data type of the field.

size int

The size of the field.

required bool

Indicates whether the field is required.

filterMode FilterMode

The 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 string

The field name.

label string

The label or description.

dataType FieldType

The data type of the field.

size int

The size of the field.

required bool

Indicates whether the field is required.

filterMode FilterMode

The filter mode of the field.

dataBehavior FieldBehavior

Specifies 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 string

The primary key field name.

label string

The label or description.

dataType FieldType

The data type of the field.

size int

The size of the field.

autoNum bool

Indicates whether the field is auto-incremented.

filterMode FilterMode

The 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

bool

ContainsKey(string)

Determines whether a field with the specified name exists in the list.

public bool ContainsKey(string name)

Parameters

name string

The 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

ElementFieldList

FindAll(Predicate<ElementField>)

public List<ElementField> FindAll(Predicate<ElementField> predicate)

Parameters

predicate Predicate<ElementField>

Returns

List<ElementField>

GetAsList()

public List<ElementField> GetAsList()

Returns

List<ElementField>

GetEnumerator()

public IEnumerator<ElementField> GetEnumerator()

Returns

IEnumerator<ElementField>

IndexOf(ElementField)

public int IndexOf(ElementField item)

Parameters

item ElementField

Returns

int

Insert(int, ElementField)

public void Insert(int index, ElementField item)

Parameters

index int
item ElementField

Remove(ElementField)

public bool Remove(ElementField item)

Parameters

item ElementField

Returns

bool

RemoveAt(int)

public void RemoveAt(int index)

Parameters

index int