Example #1
0
        private void API_WanListReceived(List <Radio> radioListFromServer)
        {
            string lastSelectedWanRadioSerial = "";
            bool   selradioiswan = _selectedRadio != null && _selectedRadio.Radio.IsWan;

            lock (_sllock)
            {
                if (selradioiswan)
                {
                    lastSelectedWanRadioSerial = _selectedRadio.Radio.Serial;
                }
                _SmartLinkRadios.Clear();
                foreach (Radio r in radioListFromServer)
                {
                    _SmartLinkRadios.Add(new RadioViewData(r));
                }
                base.RaisePropertyChanged("SmartLinkRadios");
                this.RemoveAllFoundWanRadios();
                this.AddWanRadiosToList();
                this.UpdateSelectedSmartLinkRadio();
            }
            if (selradioiswan)
            {
                InvokeHelper.BeginInvokeIfNeeded(Application.Current.Dispatcher, delegate
                {
                    RadioViewData rvd = this._RadiosFound.FirstOrDefault((RadioViewData r) => r.Radio.Serial == lastSelectedWanRadioSerial);
                    if (rvd != null)
                    {
                        this.SelectedRadio = rvd;
                    }
                });
            }
        }