Class CsvEntityList<TKey, TEntity>
- Namespace
- StockSharp.Algo.Storages.Csv
- Assembly
- StockSharp.Algo.dll
List of trade objects, received from the CSV storage.
public abstract class CsvEntityList<TKey, TEntity> : SynchronizedList<TEntity>, IList, ICollection, INotifyListEx<TEntity>, IListEx<TEntity>, ICollectionEx<TEntity>, IStorageEntityList<TEntity>, INotifyList<TEntity>, INotifyCollection<TEntity>, IList<TEntity>, ISynchronizedCollection<TEntity>, ICollection<TEntity>, IEnumerable<TEntity>, IEnumerable, ISynchronizedCollection, ICsvEntityList where TEntity : classType Parameters
- TKey
- Key type. 
- TEntity
- Entity type. 
- Inheritance
- 
      
      BaseCollection<TEntity, List<TEntity>>SynchronizedCollection<TEntity, List<TEntity>>SynchronizedList<TEntity>CsvEntityList<TKey, TEntity>
- Implements
- 
      
      
      INotifyListEx<TEntity>IListEx<TEntity>ICollectionEx<TEntity>IStorageEntityList<TEntity>INotifyList<TEntity>INotifyCollection<TEntity>IList<TEntity>ISynchronizedCollection<TEntity>ICollection<TEntity>IEnumerable<TEntity>
- Inherited Members
- Extension Methods
Constructors
CsvEntityList(CsvEntityRegistry, string)
Initializes a new instance of the CsvEntityList<TKey, TEntity>.
protected CsvEntityList(CsvEntityRegistry registry, string fileName)Parameters
- registryCsvEntityRegistry
- The CSV storage of trading objects. 
- fileNamestring
- CSV file name. 
Properties
Cache
Cached items.
public TEntity[] Cache { get; }Property Value
- TEntity[]
CreateArchivedCopy
Create archived copy.
public bool CreateArchivedCopy { get; set; }Property Value
DelayAction
The interface for presentation in the form of list of trade objects, received from the external storage.
public DelayAction DelayAction { get; set; }Property Value
FileName
CSV file name.
public string FileName { get; }Property Value
Registry
The CSV storage of trading objects.
protected CsvEntityRegistry Registry { get; }Property Value
Methods
AddCache(TEntity)
Add item to cache.
protected virtual void AddCache(TEntity item)Parameters
- itemTEntity
- New item. 
ClearCache()
Clear cache.
protected virtual void ClearCache()Contains(TEntity)
public override bool Contains(TEntity item)Parameters
- itemTEntity
Returns
GetCopy()
Get archived copy body.
public byte[] GetCopy()Returns
- byte[]
- File body. 
GetKey(TEntity)
Get key from trade object.
protected abstract TKey GetKey(TEntity item)Parameters
- itemTEntity
- Trade object. 
Returns
- TKey
- The key. 
IsChanged(TEntity, bool)
Is entity changed.
protected virtual bool IsChanged(TEntity entity, bool forced)Parameters
- entityTEntity
- Trade object. 
- forcedbool
- Forced update. 
Returns
- bool
- Is changed. 
OnAdding(TEntity)
protected override bool OnAdding(TEntity item)Parameters
- itemTEntity
- Trade object. 
Returns
OnCleared()
protected override void OnCleared()OnRemoved(TEntity)
protected override void OnRemoved(TEntity item)Parameters
- itemTEntity
- Trade object. 
OnRemovedRange(IEnumerable<TEntity>)
protected void OnRemovedRange(IEnumerable<TEntity> items)Parameters
- itemsIEnumerable<TEntity>
Read(FastCsvReader)
Read data from CSV.
protected abstract TEntity Read(FastCsvReader reader)Parameters
- readerFastCsvReader
- CSV reader. 
Returns
- TEntity
- Trade object. 
RemoveCache(TEntity)
Remove item from cache.
protected virtual void RemoveCache(TEntity item)Parameters
- itemTEntity
- Item. 
Save(TEntity)
To save the trading object.
public void Save(TEntity entity)Parameters
- entityTEntity
- The trading object. 
Save(TEntity, bool)
Save object into storage.
public virtual void Save(TEntity entity, bool forced)Parameters
- entityTEntity
- Trade object. 
- forcedbool
- Forced update. 
ToString()
public override string ToString()Returns
UpdateCache(TEntity)
Update item in cache.
protected virtual void UpdateCache(TEntity item)Parameters
- itemTEntity
- Item. 
Write(CsvFileWriter, TEntity)
Write data into CSV.
protected abstract void Write(CsvFileWriter writer, TEntity data)Parameters
- writerCsvFileWriter
- CSV writer. 
- dataTEntity
- Trade object.