コード例 #1
0
        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)));
        }
コード例 #2
0
        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)));
        }
コード例 #3
0
 public ReceiverPathViewModel(ReceiverPath receiverPath)
 {
     ReceiverPath = receiverPath;
 }