Exemple #1
0
        public void Refactor()
        {
            var presenter = _factory.Create();

            if (presenter == null)
            {
                return;
            }

            _model = presenter.Show();
            if (_model == null)
            {
                return;
            }

            using (var pane = _vbe.ActiveCodePane)
            {
                if (pane.IsWrappingNullReference)
                {
                    return;
                }

                var oldSelection = pane.GetQualifiedSelection();

                AddInterface();

                if (oldSelection.HasValue)
                {
                    pane.Selection = oldSelection.Value.Selection;
                }
            }

            _model.State.OnParseRequested(this);
        }
Exemple #2
0
        public void Refactor()
        {
            var presenter = _factory.Create();

            if (presenter == null)
            {
                return;
            }

            _model = presenter.Show();
            if (_model == null)
            {
                return;
            }

            QualifiedSelection?oldSelection = null;

            if (_vbe.ActiveCodePane != null)
            {
                oldSelection = _vbe.ActiveCodePane.CodeModule.GetSelection();
            }

            AddInterface();

            if (oldSelection.HasValue)
            {
                oldSelection.Value.QualifiedName.Component.CodeModule.SetSelection(oldSelection.Value.Selection);
                oldSelection.Value.QualifiedName.Component.CodeModule.CodePane.ForceFocus();
            }

            _state.OnParseRequested(this);
        }
        public void Refactor()
        {
            _model = InitializeModel();

            if (_model == null)
            {
                return;
            }

            using (var presenterContainer = _presenterFactory(_model))
            {
                var presenter = presenterContainer.Value;
                if (presenter == null)
                {
                    return;
                }

                _model = presenter.Show();
                if (_model == null)
                {
                    return;
                }

                AddInterface();
            }
        }
        public ExtractInterfacePresenter Create()
        {
            var pane = _vbe.ActiveCodePane;

            if (pane == null || pane.IsWrappingNullReference)
            {
                return(null);
            }
            var selection = pane.GetQualifiedSelection();

            if (selection == null)
            {
                return(null);
            }

            var model = new ExtractInterfaceModel(_state, selection.Value);

            if (!model.Members.Any())
            {
                // don't show the UI if there's no member to extract
                return(null);
            }

            return(new ExtractInterfacePresenter(_view, model));
        }
Exemple #5
0
        public ExtractInterfacePresenter Create()
        {
            var selection = _vbe.GetActiveSelection();

            if (selection == null)
            {
                return(null);
            }

            var model = new ExtractInterfaceModel(_state, selection.Value);

            // don't show the UI if there's no memeber to extract
            return(model.Members.Any() ? new ExtractInterfacePresenter(_view, model) : null);
        }
        public void Refactor()
        {
            var presenter = _factory.Create();

            if (presenter == null)
            {
                return;
            }

            _model = presenter.Show();

            if (_model == null)
            {
                return;
            }

            AddInterface();
        }
Exemple #7
0
        public ExtractInterfacePresenter Create()
        {
            var selection = _vbe.ActiveCodePane.CodeModule.GetSelection();

            if (selection == null)
            {
                return(null);
            }

            var model = new ExtractInterfaceModel(_state, selection.Value);

            if (!model.Members.Any())
            {
                // don't show the UI if there's no member to extract
                return(null);
            }

            return(new ExtractInterfacePresenter(_view, model));
        }
        public void Refactor()
        {
            var presenter = _factory.Create();

            if (presenter == null)
            {
                return;
            }

            _model = presenter.Show();

            if (_model == null)
            {
                return;
            }

            AddInterface();

            _state.OnParseRequested(this);
        }
        public void Refactor()
        {
            var presenter = _factory.Create();

            if (presenter == null)
            {
                return;
            }

            _model = presenter.Show();
            if (_model == null)
            {
                return;
            }

            var pane = _vbe.ActiveCodePane;
            {
                QualifiedSelection?oldSelection;
                if (!pane.IsWrappingNullReference)
                {
                    var module = pane.CodeModule;
                    {
                        oldSelection = module.GetQualifiedSelection();
                    }
                }
                else
                {
                    return;
                }

                AddInterface();

                if (oldSelection.HasValue)
                {
                    pane.Selection = oldSelection.Value.Selection;
                }
            }
        }
 public ExtractInterfacePresenter(IRefactoringDialog <ExtractInterfaceViewModel> view, ExtractInterfaceModel model)
 {
     _view  = view;
     _model = model;
 }
Exemple #11
0
 public ExtractInterfacePresenter(IExtractInterfaceView view, ExtractInterfaceModel model)
 {
     _view  = view;
     _model = model;
 }