예제 #1
0
            public ExtractMethodRequest GetExtractionInfo(ExtractedMethodCreator previewer)
            {
                AP.ScopeInfo scope = null;
                if (_scopeName == null)
                {
                    scope = previewer.LastExtraction.scopes[0];
                }
                else
                {
                    foreach (var foundScope in previewer.LastExtraction.scopes)
                    {
                        if (foundScope.name == _scopeName)
                        {
                            scope = foundScope;
                            break;
                        }
                    }
                }

                Assert.AreNotEqual(null, scope);
                var requestView = new ExtractMethodRequestView(PythonToolsTestUtilities.CreateMockServiceProvider(), previewer);

                requestView.TargetScope = requestView.TargetScopes.Single(s => s.Scope == scope);
                requestView.Name        = _targetName;
                foreach (var cv in requestView.ClosureVariables)
                {
                    cv.IsClosure = !_parameters.Contains(cv.Name);
                }
                Assert.IsTrue(requestView.IsValid);
                var request = requestView.GetRequest();

                Assert.IsNotNull(request);
                return(request);
            }
예제 #2
0
        public ExtractMethodDialog(ExtractMethodRequestView viewModel) {
            DataContext = viewModel;

            InitializeComponent();

            _firstActivation = true;
        }
예제 #3
0
        public ExtractMethodRequest GetExtractionInfo(ExtractedMethodCreator previewer) {
            var requestView = new ExtractMethodRequestView(_serviceProvider, previewer);
            var dialog = new ExtractMethodDialog(requestView);

            bool res = dialog.ShowModal() ?? false;
            if (res) {
                return requestView.GetRequest();
            }

            return null;
        }
예제 #4
0
        public ExtractMethodRequest GetExtractionInfo(ExtractedMethodCreator previewer)
        {
            var requestView = new ExtractMethodRequestView(_serviceProvider, previewer);
            var dialog      = new ExtractMethodDialog(requestView);

            bool res = dialog.ShowModal() ?? false;

            if (res)
            {
                return(requestView.GetRequest());
            }

            return(null);
        }
예제 #5
0
            public ExtractMethodRequest GetExtractionInfo(ExtractedMethodCreator previewer) {
                AP.ScopeInfo scope = null;
                if (_scopeName == null) {
                    scope = previewer.LastExtraction.scopes[0];
                } else {
                    foreach (var foundScope in previewer.LastExtraction.scopes) {
                        if (foundScope.name == _scopeName) {
                            scope = foundScope;
                            break;
                        }
                    }
                }

                Assert.AreNotEqual(null, scope);
                var requestView = new ExtractMethodRequestView(PythonToolsTestUtilities.CreateMockServiceProvider(), previewer);
                requestView.TargetScope = requestView.TargetScopes.Single(s => s.Scope == scope);
                requestView.Name = _targetName;
                foreach (var cv in requestView.ClosureVariables) {
                    cv.IsClosure = !_parameters.Contains(cv.Name);
                }
                Assert.IsTrue(requestView.IsValid);
                var request = requestView.GetRequest();
                Assert.IsNotNull(request);
                return request;
            }