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 : class
Type Parameters
TKeyKey type.
TEntityEntity 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
registryCsvEntityRegistryThe CSV storage of trading objects.
fileNamestringCSV 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
itemTEntityNew 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
itemTEntityTrade object.
Returns
- TKey
The key.
IsChanged(TEntity, bool)
Is entity changed.
protected virtual bool IsChanged(TEntity entity, bool forced)
Parameters
entityTEntityTrade object.
forcedboolForced update.
Returns
- bool
Is changed.
OnAdding(TEntity)
protected override bool OnAdding(TEntity item)
Parameters
itemTEntityTrade object.
Returns
OnCleared()
protected override void OnCleared()
OnRemoved(TEntity)
protected override void OnRemoved(TEntity item)
Parameters
itemTEntityTrade 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
readerFastCsvReaderCSV reader.
Returns
- TEntity
Trade object.
RemoveCache(TEntity)
Remove item from cache.
protected virtual void RemoveCache(TEntity item)
Parameters
itemTEntityItem.
Save(TEntity)
To save the trading object.
public void Save(TEntity entity)
Parameters
entityTEntityThe trading object.
Save(TEntity, bool)
Save object into storage.
public virtual void Save(TEntity entity, bool forced)
Parameters
entityTEntityTrade object.
forcedboolForced update.
ToString()
public override string ToString()
Returns
UpdateCache(TEntity)
Update item in cache.
protected virtual void UpdateCache(TEntity item)
Parameters
itemTEntityItem.
Write(CsvFileWriter, TEntity)
Write data into CSV.
protected abstract void Write(CsvFileWriter writer, TEntity data)
Parameters
writerCsvFileWriterCSV writer.
dataTEntityTrade object.