Ejemplo n.º 1
0
 public void Visit(StopCollection stops)
 {
     using (var textReader = GetTextReader <Stop>())
     {
         Feed.Stops = new StopCollection(GetEntityParser <Stop>().Parse(textReader).Cast <Stop>());
     }
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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]);
        }
Ejemplo n.º 4
0
 public void Visit(StopCollection stops)
 {
     SetValidity(stops);
 }
Ejemplo n.º 5
0
 protected ExitStrategy(StopCollection stops)
 {
     Stops = stops;
     Stops.Sort();
 }
Ejemplo n.º 6
0
 public void Visit(StopCollection stops)
 {
     OnStopsChecked(stops, new ValidationEventArgs(CheckValidity(stops)));
 }
Ejemplo n.º 7
0
 protected virtual void OnStopsChecked(StopCollection stops, ValidationEventArgs e)
 {
     StopsChecked?.Invoke(stops, e);
 }