예제 #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);
        }
예제 #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;
            }
예제 #3
0
 public FakeStorage(CsvEntityRegistry registry)
 {
     _registry = registry;
 }
예제 #4
0
 public SecurityCsvList(CsvEntityRegistry registry)
     : base(registry, "security.csv")
 {
     ((ICollectionEx <Security>) this).AddedRange   += s => _added?.Invoke(s);
     ((ICollectionEx <Security>) this).RemovedRange += s => _removed?.Invoke(s);
 }
예제 #5
0
 public ExchangeBoardCsvList(CsvEntityRegistry registry)
     : base(registry, "exchangeboard.csv")
 {
 }
예제 #6
0
 public ExchangeCsvList(CsvEntityRegistry registry)
     : base(registry, "exchange.csv")
 {
 }
예제 #7
0
 public PositionCsvList(CsvEntityRegistry registry)
     : base(registry, "position.csv", Encoding.UTF8)
 {
 }
예제 #8
0
 public PortfolioCsvList(CsvEntityRegistry registry)
     : base(registry, "portfolio.csv", Encoding.UTF8)
 {
 }
예제 #9
0
 public ExchangeBoardCsvList(CsvEntityRegistry registry)
     : base(registry, "exchangeboard.csv", Encoding.UTF8)
 {
 }
예제 #10
0
 public SecurityCsvList(CsvEntityRegistry registry)
     : base(registry, "security.csv")
 {
     AddedRange   += s => _added?.Invoke(s);
     RemovedRange += s => _removed?.Invoke(s);
 }
예제 #11
0
 public FakeStorage(CsvEntityRegistry registry)
 {
     _registry = registry ?? throw new ArgumentNullException(nameof(registry));
 }
예제 #12
0
 public PositionCsvList(CsvEntityRegistry registry)
     : base(registry, "position.csv")
 {
 }
예제 #13
0
 public PortfolioCsvList(CsvEntityRegistry registry)
     : base(registry, "portfolio.csv")
 {
 }
예제 #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);
 }