internal bool TrySubmit()
        {
            var canSubmit = AllParameters.Any(p => p.IsRemoved) ||
                            AllParameters.Any(p => p is AddedParameterViewModel) ||
                            !_parametersWithoutDefaultValues.OfType <ExistingParameterViewModel>().Select(p => p.ParameterSymbol).SequenceEqual(_originalParameterConfiguration.ParametersWithoutDefaultValues.Cast <ExistingParameter>().Select(p => p.Symbol)) ||
                            !_parametersWithDefaultValues.OfType <ExistingParameterViewModel>().Select(p => p.ParameterSymbol).SequenceEqual(_originalParameterConfiguration.RemainingEditableParameters.Cast <ExistingParameter>().Select(p => p.Symbol));

            if (!canSubmit)
            {
                _notificationService.SendNotification(ServicesVSResources.You_must_change_the_signature, severity: NotificationSeverity.Information);
                return(false);
            }

            return(true);
        }
Exemple #2
0
        private bool EditableParameterSelected(out int index)
        {
            index = -1;

            if (!AllParameters.Any())
            {
                return(false);
            }

            if (!SelectedIndex.HasValue)
            {
                return(false);
            }

            index = SelectedIndex.Value;

            if (index == 0 && _thisParameter != null)
            {
                return(false);
            }

            return(true);
        }