Esempio n. 1
0
        private void Generate_OnClick(object sender, RoutedEventArgs e)
        {
            var helper    = new AddNewServiceMethodHelper(_serviceProvider);
            var parameter = new Dictionary <string, object>();
            var names     = Regex.Split(txtNames.Text, @"\r\n");

            if (HelperBase.MessageBox("{0} method{1} will be generated. OK?", MessageBoxButton.OKCancel, MessageBoxImage.Question, names.Length, (names.Length > 1 ? "s" : string.Empty)) == MessageBoxResult.Cancel)
            {
                return;
            }
            parameter["names"] = names;
            parameter["async"] = chkAsync.IsChecked;

            if (helper.CanExecute(parameter))
            {
                helper.Execute(parameter);
            }
        }
        private void Generate_OnClick(object sender, RoutedEventArgs e)
        {
            var helper = new AddNewServiceMethodHelper(_serviceProvider);
            var names  = Regex.Split(txtNames.Text, @"\r\n");

            if (HelperBase.MessageBox("{0} method{1} will be generated. OK?", MessageBoxButton.OKCancel, MessageBoxImage.Question, names.Length, (names.Length > 1 ? "s" : string.Empty)) == MessageBoxResult.Cancel)
            {
                return;
            }
            var input = new ExecuteInput
            {
                MethodNames = names,
                IsAsync     = chkAsync.IsChecked ?? true
            };

            if (helper.CanExecute(input))
            {
                helper.Execute(input);
            }
        }
        private void ExecuteGenerateCommand()
        {
            var helper = new AddNewServiceMethodHelper(AbpHelperWindowControl.ServiceProvider);
            var names  = Regex.Split(Names, @"\r\n");

            if (Utils.MessageBox("{0} method{1} will be generated. OK?", MessageBoxButton.OKCancel, MessageBoxImage.Question, names.Length, (names.Length > 1 ? "s" : string.Empty)) == MessageBoxResult.Cancel)
            {
                return;
            }

            var parameter = new AddNewServiceMethodModel()
            {
                Names   = names,
                IsAsync = IsAsync,
            };

            if (helper.CanExecute(parameter))
            {
                helper.Execute(parameter);
            }
        }