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