public void Visit(StopCollection stops) { using (var textReader = GetTextReader <Stop>()) { Feed.Stops = new StopCollection(GetEntityParser <Stop>().Parse(textReader).Cast <Stop>()); } }
public override void Initialize(IStrip s, PluginConfig config) { base.Initialize(s, config); s2d = s as RGBWStrip2D; if (s2d == null) { throw new ArgumentException("Strip must be of type RGBWStrip2D"); } baseURL = (string)config["baseURL"]; var tok = (JToken)config["busStops"]; var busstops = tok.ToObject <BusStop[]>(); var loc = config.location.Replace("(", "").Replace(")", "").Split(",").Select(x => int.Parse(x.Trim())); this.location = new Point(loc.ElementAt(0), loc.ElementAt(1)); stops = new StopCollection(baseURL, busstops); }
public void BothValuesSet() { var trailingStop = new TrailingStop { InitiateAtGainPercentage = 7 }; var standardStop = new StandardStop { InitiateAtGainPercentage = 10 }; var stops = new StopCollection { standardStop, trailingStop }; stops.Sort(); Assert.Equal(trailingStop, stops[0]); Assert.Equal(standardStop, stops[1]); }
public void Visit(StopCollection stops) { SetValidity(stops); }
protected ExitStrategy(StopCollection stops) { Stops = stops; Stops.Sort(); }
public void Visit(StopCollection stops) { OnStopsChecked(stops, new ValidationEventArgs(CheckValidity(stops))); }
protected virtual void OnStopsChecked(StopCollection stops, ValidationEventArgs e) { StopsChecked?.Invoke(stops, e); }