Class DefList<T>
- Namespace
- Tripous
- Assembly
- Tripous.dll
An observable list of IDef items.
public class DefList<T> : TripousList<T>, IList<T>, IList, ICollection<T>, IEnumerable<T>, ICollection, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged, IJsonLoadable where T : IDef
Type Parameters
T
- Inheritance
-
TripousList<T>DefList<T>
- Implements
-
IList<T>ICollection<T>IEnumerable<T>
- Derived
- Inherited Members
- Extension Methods
Constructors
DefList()
Constructor
public DefList()
Properties
AllowDuplicateNames
In some cases, e.g. SQL WHERE filters, we may need the same name twice when constructing something like
MyDate >= Value1 and MyDate <= Value2
public bool AllowDuplicateNames { get; set; }
Property Value
this[string]
Indexer
[JsonIgnore]
public T this[string Name] { get; }
Parameters
Namestring
Property Value
- T
ReadOnlyList
The list of items.
[JsonIgnore]
public ReadOnlyCollection<T> ReadOnlyList { get; }
Property Value
Methods
CheckAdding(T)
Overrides the base method to check for duplicate names.
protected override void CheckAdding(T Def)
Parameters
DefT
CheckDescriptors()
Throws an exception if this descriptor is not fully defined
public virtual void CheckDescriptors()
Contains(string)
Returns true if a specified item is in the list.
public bool Contains(string Name)
Parameters
Namestring
Returns
Find(string)
Returns an item, if any, else null.
public T Find(string Name)
Parameters
Namestring
Returns
- T
FindOrAddRange(string[])
Finds items by name. It adds a new item if an item is not found.
public List<T> FindOrAddRange(string[] Names)
Parameters
Namesstring[]
Returns
- List<T>
FindOrdAdd(string)
Finds an item by name. It adds a new item if the item is not found.
public T FindOrdAdd(string Name)
Parameters
Namestring
Returns
- T
Get(string)
Returns an item, if any, else exception.
public T Get(string Name)
Parameters
Namestring
Returns
- T
IndexOf(string)
Returns the index of an item or -1 if not found.
public int IndexOf(string Name)
Parameters
Namestring
Returns
InsertAfter(string, T)
Inserts an item after another, spefified by its name.
public bool InsertAfter(string AfterName, T Def)
Parameters
AfterNamestringDefT
Returns
InsertBefore(string, T)
Inserts an item before another, spefified by its name.
public bool InsertBefore(string BeforeName, T Def)
Parameters
BeforeNamestringDefT
Returns
JsonLoaded()
Called by the Json after deserializing an item.
public virtual void JsonLoaded()
Sort()
Sorts all items by TitleKey
public virtual void Sort()
UpdateReferences()
Updates references such as when an instance has references to other instances, e.g. tables of a module definition.
public virtual void UpdateReferences()