Example #1
0
        private async void HydrateServerPingDtoList()
        {
            if (this.ServerPingDtoList == null)
            {
                IEnumerable allServers =
                    await Task.Run(() =>
                {
                    using (var prestoWcf = new PrestoWcf <IServerService>())
                    {
                        return(prestoWcf.Service.GetAllServers(false));
                    }
                });

                var localDtoList = new List <ServerPingDto>();

                foreach (ApplicationServer server in allServers)
                {
                    localDtoList.Add(new ServerPingDto()
                    {
                        ApplicationServer = server
                    });
                }

                this.ServerPingDtoList = new PrestoObservableCollection <ServerPingDto>();
                this.ServerPingDtoList.ClearItemsAndNotifyChangeOnlyWhenDone();
                this.ServerPingDtoList.AddRange(localDtoList);

                NotifyPropertyChanged(() => this.ServerPingDtoList);

                Refresh(null);

                _pingsLoaded = true;
                NotifyPropertyChanged(() => ShowWaitCursor);
            }
        }
Example #2
0
        public CustomVariableGroupSelectorViewModel(PrestoObservableCollection <CustomVariableGroup> alreadySelectedCvgs)
        {
            Initialize();

            if (alreadySelectedCvgs != null && alreadySelectedCvgs.Count > 0)
            {
                this._alreadySelectedCvgs = new List <CustomVariableGroup>(alreadySelectedCvgs.ToList());
            }
        }
Example #3
0
        private void SelectGroup()
        {
            CustomVariableGroupSelectorViewModel groupViewModel = new CustomVariableGroupSelectorViewModel(_selectedCustomVariableGroups);

            MainWindowViewModel.ViewLoader.ShowDialog(groupViewModel);

            if (groupViewModel.UserCanceled)
            {
                return;
            }

            // Store the (possibly) multiple selected groups.
            _selectedCustomVariableGroups = groupViewModel.SelectedCustomVariableGroups;
            this.ApplicationWithGroup.CustomVariableGroups = groupViewModel.SelectedCustomVariableGroups;

            this.ResolvedCustomVariables.Clear();
        }