Show / Hide Table of Contents

Class PersistableCollection<T>

This collection class supports persistence of generic items.

Inheritance
System.Object
SynchronizedList<T>
PersistableCollection<T>
LapCollection
MapCollection<T>
SessionDataItemsCollection<T>
Implements
System.Collections.IList
System.Collections.ICollection
IPersistableCollection<T>
System.Collections.Generic.IList<T>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
Inherited Members
SynchronizedList<T>.Add(T)
SynchronizedList<T>.CopyTo(T[], Int32)
SynchronizedList<T>.IndexOf(T)
SynchronizedList<T>.Contains(T)
SynchronizedList<T>.GetEnumerator()
SynchronizedList<T>.Clone()
SynchronizedList<T>.Remove(T)
SynchronizedList<T>.Insert(Int32, T)
SynchronizedList<T>.Add(Object)
SynchronizedList<T>.Contains(Object)
SynchronizedList<T>.IndexOf(Object)
SynchronizedList<T>.Insert(Int32, Object)
SynchronizedList<T>.Remove(Object)
SynchronizedList<T>.AddBase(Object)
SynchronizedList<T>.CopyTo(Array, Int32)
SynchronizedList<T>.CopyToBase(Array, Int32)
SynchronizedList<T>.Items
SynchronizedList<T>.Item[Int32]
SynchronizedList<T>.Count
SynchronizedList<T>.IsSynchronized
SynchronizedList<T>.IsFixedSize
SynchronizedList<T>.SyncRoot
Namespace: MESL.SqlRace.Domain.Collections
Assembly: MESL.SqlRace.Domain.dll
Syntax
public class PersistableCollection<T> : SynchronizedList<T>, IList, ICollection, IPersistableCollectionInternal<T>, IPersistableCollection<T>, IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable where T : EntityBase
Type Parameters
Name Description
T

Type of object in collection

Remarks

When each of the methods in this collection is called, the T data is persisted to the SQL Race data store immediately.

Methods

Add(IEnumerable<T>)

A collection that can be persisted to and underlying data store.

Declaration
public override void Add(IEnumerable<T> elements)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<T> elements
Overrides
MESL.SqlRace.Domain.Collections.SynchronizedList<T>.Add(System.Collections.Generic.IEnumerable<T>)

AddNoRepository(T)

Adds the item without modifying the repository.

Declaration
protected virtual void AddNoRepository(T item)
Parameters
Type Name Description
T item

The item.

Clear()

Clears all items from the collection

Declaration
public void Clear()

ClearItems()

Clears the items.

Declaration
protected override void ClearItems()
Overrides
MESL.SqlRace.Domain.Collections.SynchronizedList<T>.ClearItems()

InitialAddItems(IEnumerable<T>)

This is used as part of initialization of the collection by adding in the items. This will add the items using the AddNoRepository method call.

Declaration
protected void InitialAddItems(IEnumerable<T> items)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<T> items

InsertItem(Int32, T)

Inserts the item.

Declaration
protected override void InsertItem(int index, T newItem)
Parameters
Type Name Description
System.Int32 index

The index.

T newItem

The new item.

Overrides
MESL.SqlRace.Domain.Collections.SynchronizedList<T>.InsertItem(System.Int32, T)

Overwrite(T, Predicate<T>)

Overwrites first matching item with the specified item, else adds item to collection.

Declaration
public bool Overwrite(T item, Predicate<T> func)
Parameters
Type Name Description
T item

The new item.

System.Predicate<T> func

The predicate func.

Returns
Type Description
System.Boolean

True if item was overwritten

PublishAddedEvent(T)

Publishes the added event.

Declaration
protected virtual void PublishAddedEvent(T item)
Parameters
Type Name Description
T item

The added item.

PublishRemovedEvent(T)

Publishes the removed event.

Declaration
protected virtual void PublishRemovedEvent(T item)
Parameters
Type Name Description
T item

The removed item.

RemoveAll(Predicate<T>)

Removes all items matching predicate.

Declaration
public bool RemoveAll(Predicate<T> func)
Parameters
Type Name Description
System.Predicate<T> func

The predicate func.

Returns
Type Description
System.Boolean

True if items were removed

RemoveItem(Int32)

Removes the item.

Declaration
protected override void RemoveItem(int index)
Parameters
Type Name Description
System.Int32 index

The index.

Overrides
MESL.SqlRace.Domain.Collections.SynchronizedList<T>.RemoveItem(System.Int32)

RemoveNoRepository(T)

Removes the item without modifying the repository.

Declaration
protected virtual void RemoveNoRepository(T item)
Parameters
Type Name Description
T item

The item.

SetItem(Int32, T)

Sets the item.

Declaration
protected override void SetItem(int index, T newItem)
Parameters
Type Name Description
System.Int32 index

The index.

T newItem

The new item.

Overrides
MESL.SqlRace.Domain.Collections.SynchronizedList<T>.SetItem(System.Int32, T)

Events

ItemAdded

Event fired when an item is added to the collection

Declaration
public event EventHandler<ItemEventArgs> ItemAdded
Event Type
Type Description
System.EventHandler<ItemEventArgs>

ItemRemoved

Event fired when an item is removed from the collection

Declaration
public event EventHandler<ItemEventArgs> ItemRemoved
Event Type
Type Description
System.EventHandler<ItemEventArgs>

Implements

System.Collections.IList
System.Collections.ICollection
IPersistableCollection<T>
System.Collections.Generic.IList<>
System.Collections.Generic.ICollection<>
System.Collections.Generic.IEnumerable<>
System.Collections.IEnumerable
Back to top Generated by DocFX