Class BasePersistedCollection<TItem>

The parent class for persisted collection classes.

System.Object
  Stonefield.Collections.BaseKeyedCollection<TItem>
    Stonefield.Collections.BasePersistedCollection<TItem>
public abstract class BasePersistedCollection<TItem> : BaseKeyedCollection<TItem>, IPersistedCollection<TItem>

Remarks

It's abstract because it must be subclassed into specific classes.

Class Members

MemberDescription

Constructor

The constructor accepts an IProvider object to connect to the database.

CollectionChanged

Add

public virtual void Add(TItem item);

CanRemoveItem

Determines if the item can be removed from the collection and the table.

public virtual bool CanRemoveItem(TItem item);

CanSaveItem

Determines if the specified item can be saved.

public virtual bool CanSaveItem(TItem item);

Clear

public virtual void Clear();

Contains

public sealed bool Contains(TItem item);

CopyTo

public virtual void CopyTo(TItem[] array,
    int arrayIndex);

CreateTable

Creates the table if it doesn't exist using the specified open connection.

public virtual void CreateTable(IDbConnection conn);

public virtual void CreateTable();

DeleteItem

Removes the specified item from the table and the collection.

public virtual bool DeleteItem(string ID);

public virtual bool DeleteItem(TItem item);

GetEnumerator

public virtual IEnumerator<TItem> GetEnumerator();

GetItem

public sealed TItem GetItem(string name);

public sealed TItem GetItem(int index);

GetItems

public TItem[] GetItems();

LoadCollection

Loads the collection from the table.

public virtual void LoadCollection();

public virtual void LoadCollection(IDbConnection conn);

public virtual void LoadCollection(IDbConnection conn,
    bool checkForDuplicates);

New

public virtual TItem New(string name);

public virtual TItem New();

Remove

public virtual bool Remove(TItem item);

SaveItem

Saves the specified item to the table.

public virtual bool SaveItem(TItem item);

public virtual void SaveItem(TItem item,
    IDbConnection conn)

Count

IsReadOnly

Item

Provider

The provider that connects to the database.

Requirements

Namespace: Stonefield.Collections
Assembly: collections.dll