Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CsvEntityList{TKey,TEntity}"/>.
        /// </summary>
        /// <param name="registry">The CSV storage of trading objects.</param>
        /// <param name="fileName">CSV file name.</param>
        protected CsvEntityList(CsvEntityRegistry registry, string fileName)
        {
            if (fileName == null)
            {
                throw new ArgumentNullException(nameof(fileName));
            }

            Registry = registry ?? throw new ArgumentNullException(nameof(registry));

            FileName = Path.Combine(Registry.Path, fileName);
        }
Exemple #2
0
            protected CsvEntityList(CsvEntityRegistry registry, string fileName, Encoding encoding)
            {
                if (registry == null)
                {
                    throw new ArgumentNullException(nameof(registry));
                }

                if (fileName == null)
                {
                    throw new ArgumentNullException(nameof(fileName));
                }

                if (encoding == null)
                {
                    throw new ArgumentNullException(nameof(encoding));
                }

                Registry = registry;

                _fileName = System.IO.Path.Combine(Registry.Path, fileName);
                _encoding = encoding;
            }
 public FakeStorage(CsvEntityRegistry registry)
 {
     _registry = registry;
 }
 public SecurityCsvList(CsvEntityRegistry registry)
     : base(registry, "security.csv")
 {
     ((ICollectionEx <Security>) this).AddedRange   += s => _added?.Invoke(s);
     ((ICollectionEx <Security>) this).RemovedRange += s => _removed?.Invoke(s);
 }
 public ExchangeBoardCsvList(CsvEntityRegistry registry)
     : base(registry, "exchangeboard.csv")
 {
 }
 public ExchangeCsvList(CsvEntityRegistry registry)
     : base(registry, "exchange.csv")
 {
 }
Exemple #7
0
 public PositionCsvList(CsvEntityRegistry registry)
     : base(registry, "position.csv", Encoding.UTF8)
 {
 }
Exemple #8
0
 public PortfolioCsvList(CsvEntityRegistry registry)
     : base(registry, "portfolio.csv", Encoding.UTF8)
 {
 }
Exemple #9
0
 public ExchangeBoardCsvList(CsvEntityRegistry registry)
     : base(registry, "exchangeboard.csv", Encoding.UTF8)
 {
 }
Exemple #10
0
 public SecurityCsvList(CsvEntityRegistry registry)
     : base(registry, "security.csv")
 {
     AddedRange   += s => _added?.Invoke(s);
     RemovedRange += s => _removed?.Invoke(s);
 }
Exemple #11
0
 public FakeStorage(CsvEntityRegistry registry)
 {
     _registry = registry ?? throw new ArgumentNullException(nameof(registry));
 }
Exemple #12
0
 public PositionCsvList(CsvEntityRegistry registry)
     : base(registry, "position.csv")
 {
 }
Exemple #13
0
 public PortfolioCsvList(CsvEntityRegistry registry)
     : base(registry, "portfolio.csv")
 {
 }
Exemple #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ComplexCsvSecurityList{TSecurity}"/>.
 /// </summary>
 /// <param name="registry">The CSV storage of trading objects.</param>
 /// <param name="fileName">CSV file name.</param>
 protected ComplexCsvSecurityList(CsvEntityRegistry registry, string fileName)
     : base(registry, fileName)
 {
     ((ICollectionEx <Security>) this).AddedRange   += s => _added?.Invoke(s);
     ((ICollectionEx <Security>) this).RemovedRange += s => _removed?.Invoke(s);
 }