Esempio n. 1
0
        internal bool DeleteConnectionString(ConnectionStringViewModel vm)
        {
            if (MessageBox.Show("Are you sure you want to delete this connection string?", "Confirm Delete", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
            {
                return(false);
            }

            ConfigurationManager.DeleteConnectionString(SelectedConfig.Name, vm.Key);

            SelectedConfig.ConnectionStrings.Remove(vm);

            return(true);
        }
Esempio n. 2
0
        internal bool EditConnectionString(ConnectionStringViewModel vm)
        {
            if (!string.IsNullOrWhiteSpace(vm.Error))
            {
                vm.CancelEdit();
                return(false);
            }

            vm.EndEdit();

            ConfigurationManager.SaveConnectionString(SelectedConfig.Name, new ConnectionStringSetting {
                Name = vm.Key, Provider = vm.Provider, Value = vm.Value
            });

            return(true);
        }
        internal bool EditConnectionString(ConnectionStringViewModel vm)
        {
            if (!string.IsNullOrWhiteSpace(vm.Error))
            {
                vm.CancelEdit();
                return false;
            }

            vm.EndEdit();

            ConfigurationManager.SaveConnectionString(SelectedConfig.Name, new ConnectionStringSetting { Name = vm.Key, Provider = vm.Provider, Value = vm.Value });

            return true;
        }
        internal bool DeleteConnectionString(ConnectionStringViewModel vm)
        {
            if (MessageBox.Show("Are you sure you want to delete this connection string?", "Confirm Delete", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
                return false;

            ConfigurationManager.DeleteConnectionString(SelectedConfig.Name, vm.Key);

            SelectedConfig.ConnectionStrings.Remove(vm);

            return true;
        }