private void NewBeacon(BeaconLocation newBeacon) { var newBeacons = currentBeacons .Where(_ => !_.Equals(newBeacon)) .Concat(new [] { newBeacon }) .OrderBy(_ => _.Data) .ThenBy(_ => _.Address, IPEndpointComparer.Instance) .ToList(); var u = BeaconsUpdated; if (u != null) { u(newBeacons); } currentBeacons = newBeacons; }
protected bool Equals(BeaconLocation other) { return(Equals(Address, other.Address)); }