Table of Contents

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
DefList<T>
Implements
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

bool

this[string]

Indexer

[JsonIgnore]
public T this[string Name] { get; }

Parameters

Name string

Property Value

T

ReadOnlyList

The list of items.

[JsonIgnore]
public ReadOnlyCollection<T> ReadOnlyList { get; }

Property Value

ReadOnlyCollection<T>

Methods

CheckAdding(T)

Overrides the base method to check for duplicate names.

protected override void CheckAdding(T Def)

Parameters

Def T

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

Name string

Returns

bool

Find(string)

Returns an item, if any, else null.

public T Find(string Name)

Parameters

Name string

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

Names string[]

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

Name string

Returns

T

Get(string)

Returns an item, if any, else exception.

public T Get(string Name)

Parameters

Name string

Returns

T

IndexOf(string)

Returns the index of an item or -1 if not found.

public int IndexOf(string Name)

Parameters

Name string

Returns

int

InsertAfter(string, T)

Inserts an item after another, spefified by its name.

public bool InsertAfter(string AfterName, T Def)

Parameters

AfterName string
Def T

Returns

bool

InsertBefore(string, T)

Inserts an item before another, spefified by its name.

public bool InsertBefore(string BeforeName, T Def)

Parameters

BeforeName string
Def T

Returns

bool

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()