// Copy Constructor public Odds(Odds other) { _oddsToOne = other._oddsToOne; _format = other._format; }
public void AddRealTimeOddsToHistory(Odds odds) { lock (_realTimeOddsLocker) { _realTimeOddsHistory.Add(DateTime.Now, odds); } }
public Horse(SerializationInfo info, StreamingContext ctxt) { _programNumber = (String)info.GetValue("_programNumber", typeof(string)); _name = (String)info.GetValue("_name", typeof(string)); // TODO Jun 18 2008 // Investigate why when not use the copy constructor for morning and my odds // they both point to the same object _morningLineOdds = (Odds)info.GetValue("_morningLineOdds", typeof(Odds)); _morningLineOdds = new Odds(_morningLineOdds); _myOdds = (Odds)info.GetValue("_myOdds", typeof(Odds)); _myOdds = new Odds(_myOdds); // To ensure backwards compatibility lets use the Utilities.GetSerializedObject // instead of directly using the info.GetValue, there might be a better solution // though, but as of now I don't now it JUN 21 2008 JP _isScratched = (bool)Utilities.GetSerializedObject(info, "_isScratched", typeof(bool), false); _selectedRunningLineIndex = (int)Utilities.GetSerializedObject(info, "_selectedRunningLineIndex", typeof(int), -1); _isContenter = (bool)Utilities.GetSerializedObject(info, "_isContenter", typeof(bool), true); _isDonkey = (bool)Utilities.GetSerializedObject(info, "_isDonkey", typeof(bool), false); _comments = (string)Utilities.GetSerializedObject(info, "_comments", typeof(string), ""); _factorsPerformance = (List<FactorPerformance>)Utilities.GetSerializedObject(info, "_factorsPerformance", typeof(List<FactorPerformance>), null); _isBestBet = (bool)Utilities.GetSerializedObject(info, "_isBestBet", typeof(bool), false); _valueIndex = (int)Utilities.GetSerializedObject(info, "_valueIndex", typeof(int), 0); _weightIndex = (int)Utilities.GetSerializedObject(info, "_weightIndex", typeof(int), 0); _myOdds.Parent = this; _ds = null; if (null != _factorsPerformance) { BuildFactorPerformanceTable(); } }
internal Horse(string number, string name, Odds odds) { _programNumber = number; _name = name; _morningLineOdds = new Odds(odds); _myOdds = new Odds(odds); _myOdds.Parent = this; }