private MarketRunner GetOrAdd(RunnerId rid) { MarketRunner runner; if (!_marketRunners.TryGetValue(rid, out runner)) { runner = new MarketRunner(this, rid); _marketRunners[rid] = runner; } return(runner); }
private void OnOrderRunnerChange(OrderRunnerChange orderRunnerChange) { RunnerId rid = new RunnerId(orderRunnerChange.Id, orderRunnerChange.Hc); OrderMarketRunner orderMarketRunner; if (!_marketRunners.TryGetValue(rid, out orderMarketRunner)) { orderMarketRunner = new OrderMarketRunner(this, rid); _marketRunners[rid] = orderMarketRunner; } //update the runner orderMarketRunner.OnOrderRunnerChange(orderRunnerChange); }
// override object.Equals public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } RunnerId runnerId = (RunnerId)obj; if (_selectionId != runnerId._selectionId) { return(false); } return(_handicap == runnerId._handicap); }
public OrderMarketRunner(OrderMarket market, RunnerId runnerId) { _market = market; _runnerId = runnerId; }
public MarketRunner(Market market, RunnerId runnerId) { _market = market; _runnerId = runnerId; }