public void AddZones(double[] ranges, string key, string value) { if (Observer == null) { Log.Debug("app", "Observer is not defined yet"); return; } var zoneBuilder = Observer.ZoneBuilder(); OnEnterDefaultZoneHandler en = new OnEnterDefaultZoneHandler(this.Model); OnChangeDefaultZoneHandler ch = new OnChangeDefaultZoneHandler(this.Model); OnExitDefaultZoneHandler ex = new OnExitDefaultZoneHandler(this.Model); bool first = true; foreach (var range in ranges) { ProximityZones.Add(zoneBuilder .ForAttachmentKeyAndValue(first ? "AuparNotificationZone" : key, first ? "Always" : value) .InCustomRange(range) .WithOnEnterAction(en) .WithOnChangeAction(ch) .WithOnExitAction(ex) .Create()); Log.Debug("app", $"Proximity all ready to go! - Zone range {range} "); } Observer.AddProximityZones(ProximityZones); }