private void BuildPairs(List <ReceiverPath> receiverPaths) { var model = BleLocatorModel.Instance; var receivers = model.BleSystemConfiguration.BleReceivers; var pathDictionary = receiverPaths.ToDictionary(r => r); foreach (var currentReceiver in receivers.Values) { foreach (var otherReceiver in receivers.Values) { if (Equals(currentReceiver, otherReceiver)) { continue; } var path = new ReceiverPath(currentReceiver, otherReceiver); if (pathDictionary.ContainsKey(path)) { continue; } pathDictionary.Add(path, path); } } ReceiverPaths = new ObservableCollection <ReceiverPathViewModel>(pathDictionary.Values.Select(p => new ReceiverPathViewModel(p))); }
private void BuildPairs(List<ReceiverPath> receiverPaths) { var model = BleLocatorModel.Instance; var receivers = model.BleSystemConfiguration.BleReceivers; var pathDictionary = receiverPaths.ToDictionary(r=>r); foreach (var currentReceiver in receivers.Values) { foreach (var otherReceiver in receivers.Values) { if(Equals(currentReceiver,otherReceiver)) continue; var path = new ReceiverPath(currentReceiver, otherReceiver); if (pathDictionary.ContainsKey(path)) continue; pathDictionary.Add(path,path); } } ReceiverPaths = new ObservableCollection<ReceiverPathViewModel>(pathDictionary.Values.Select(p => new ReceiverPathViewModel(p))); }
public ReceiverPathViewModel(ReceiverPath receiverPath) { ReceiverPath = receiverPath; }