Esempio n. 1
0
        private void AddVariableGroup()
        {
            CustomVariableGroupSelectorViewModel viewModel = new CustomVariableGroupSelectorViewModel(null);

            MainWindowViewModel.ViewLoader.ShowDialog(viewModel);

            if (viewModel.UserCanceled)
            {
                return;
            }

            // ToDo: Need to validate against the new way that groups are associated with an app.
            // Note: The Presto Task Runner will throw an exception if there are duplicates, but it's
            //       still nice to let the user know right now.
            // Servers shouldn't reference custom variable groups that are associated with an application.
            //if (viewModel.SelectedCustomVariableGroups.Any(group => group.Application != null))
            //{
            //    ViewModelUtility.MainWindowViewModel.UserMessage = ViewModelResources.CannotUseGroup;
            //    return;
            //}

            viewModel.SelectedCustomVariableGroups.ForEach(group => this.SelectedApplicationServer.CustomVariableGroups.Add(group));

            SaveServer();
        }
Esempio n. 2
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();
        }