private void Refresh()
        {
            //Because refreshing removes all components, we need to store the current selection,
            // so we can correctly reset it once the files are imported from the repository.

            var codePane = Project.VBE.ActiveCodePane;

            if (codePane != null)
            {
                var codePaneWrapper = _wrapperFactory.Create(codePane);
                var selection       = new QualifiedSelection(new QualifiedModuleName(codePaneWrapper.CodeModule.Parent),
                                                             codePaneWrapper.Selection);
                string name = null;
                if (selection.QualifiedName.Component != null)
                {
                    name = selection.QualifiedName.Component.Name;
                }

                Project.RemoveAllComponents();
                Project.ImportSourceFiles(CurrentRepository.LocalLocation);

                Project.VBE.SetSelection(selection.QualifiedName.Project, selection.Selection, name, _wrapperFactory);
            }
            else
            {
                Project.RemoveAllComponents();
                Project.ImportSourceFiles(CurrentRepository.LocalLocation);
            }
        }
Exemple #2
0
        private void Refresh(IEnumerable <string> files = null)
        {
            //Because refreshing removes all components, we need to store the current selection,
            // so we can correctly reset it once the files are imported from the repository.
            var    selection = _project.VBE.ActiveCodePane.GetSelection();
            string name      = null;

            if (selection.QualifiedName.Component != null)
            {
                name = selection.QualifiedName.Component.Name;
            }

            if (files == null)
            {
                _project.RemoveAllComponents();
                _project.ImportSourceFiles(_repo.Info.WorkingDirectory);
            }
            else
            {
                foreach (var file in files)
                {
                    if (File.Exists(file))
                    {
                        string component = Path.GetFileNameWithoutExtension(file);
                        if (_project.RemoveComponent(component))
                        {
                            _project.ImportSourceFile(file);
                        }
                    }
                }
            }

            _project.VBE.SetSelection(selection.QualifiedName.Project, selection.Selection, name);
        }
        private void Refresh()
        {
            //Because refreshing removes all components, we need to store the current selection,
            // so we can correctly reset it once the files are imported from the repository.
            var selection = project.VBE.ActiveCodePane.GetSelection();

            project.RemoveAllComponents();
            project.ImportSourceFiles(CurrentRepository.LocalLocation);

            project.VBE.SetSelection(selection);
        }
Exemple #4
0
        private void Refresh()
        {
            //Because refreshing removes all components, we need to store the current selection,
            // so we can correctly reset it once the files are imported from the repository.
            var    selection = Project.VBE.ActiveCodePane.GetSelection();
            string name      = null;

            if (selection.QualifiedName.Component != null)
            {
                name = selection.QualifiedName.Component.Name;
            }

            Project.RemoveAllComponents();
            Project.ImportSourceFiles(CurrentRepository.LocalLocation);

            Project.VBE.SetSelection(selection.QualifiedName.Project, selection.Selection, name);
        }