20 using System.Collections.Generic;
32 public DateTime
Date {
get; }
52 public MapFileRow(DateTime date,
string mappedSymbol,
string primaryExchange,
54 : this(date, mappedSymbol, primaryExchange.GetPrimaryExchange(securityType, market), dataMappingMode)
73 return dataProvider.ReadLines(file)
74 .Where(l => !
string.IsNullOrWhiteSpace(l))
78 return Parse(s, market, securityType);
80 catch (ArgumentException)
86 .Where(row => row !=
null);
94 var csv = line.Split(
',');
100 primaryExchange = csv[2].GetPrimaryExchange(securityType, market);
104 mappingMode = csv[3].ParseDataMappingMode();
110 #region Equality members
121 if (ReferenceEquals(
null, other))
return false;
122 if (ReferenceEquals(
this, other))
return true;
138 if (ReferenceEquals(
null, obj))
return false;
139 if (ReferenceEquals(
this, obj))
return true;
140 if (obj.GetType() !=
this.GetType())
return false;
155 return (
Date.GetHashCode() * 397) ^
167 return Equals(left, right);
175 return !
Equals(left, right);
185 var encodedExchange =
string.Empty;
191 encodedExchange =
",";
196 encodedExchange = $
",{PrimaryExchange.Code}";
198 var mappingMode =
DataMappingMode !=
null ? $
",{(int)DataMappingMode}" :
string.Empty;
199 return $
"{Date.ToStringInvariant(DateFormat.EightCharacter)},{MappedSymbol.ToLowerInvariant()}{encodedExchange}{mappingMode}";
209 var mappingMode =
DataMappingMode !=
null ? $
" - {DataMappingMode}" :
string.Empty;
210 return Date.ToShortDateString() +
": " +
MappedSymbol + mainExchange + mappingMode;