예제 #1
0
 public CompletionSource(ITextBuffer textBuffer, ITextStructureNavigator textNavigator, IProjectExplorer projectExplorer)
 {
     _textBuffer = textBuffer;
     _textNavigator = textNavigator;
     _projectExplorer = projectExplorer;
     _viewExplorer = ViewExplorer.CreateFromActiveDocument(_projectExplorer);
 }
예제 #2
0
 public CompletionSource(ITextBuffer textBuffer, IProjectExplorer projectExplorer)
 {
     _textBuffer = textBuffer;
     _projectExplorer = projectExplorer;
     _viewExplorer = _projectExplorer.GetViewExplorer(textBuffer);
     _textBuffer.Changed += TextBuffer_Changed;
 }
예제 #3
0
        public CompletionSessionManager(ICompletionBroker broker, IProjectExplorer projectExplorer, IWpfTextView textView, ITextStructureNavigator textNavigator)
        {
            if (broker == null) throw new ArgumentNullException("broker", "Session Config is null.");
            if (projectExplorer == null) throw new ArgumentNullException("projectExplorer", "Project Explorer is null.");
            if (textView == null) throw new ArgumentNullException("textView", "Text View is null.");
            if (textNavigator == null) throw new ArgumentNullException("textNavigator", "textNavigator is null.");

            _completionBroker = broker;
            _projectExplorer = projectExplorer;
            _textView = textView;
            _textNavigator = textNavigator;
        }
예제 #4
0
        private bool TryGetEnvironmentAndView()
        {
            TextView = AdaptersFactoryService.GetWpfTextView(TextViewAdapter);
            try
            {
                VsEnvironment = (DTE)ServiceProvider.GetService(typeof(DTE));
                if (VsEnvironment != null)
                {
                    ProjectExplorer = new ProjectExplorer(VsEnvironment);
                }
            }
            catch (COMException ex)
            {
                //TODO: Log the COM Exception somewhere
                //Unable to attach to the current visual studio environment
                VsEnvironment = null;
            }

            return(TextView != null && VsEnvironment != null);
        }
예제 #5
0
        private IProjectExplorer GetFromVsEnvironment()
        {
            IProjectExplorer projectExplorer = null;

            try
            {
                VsEnvironment = (DTE)ServiceProvider.GetService(typeof(DTE));
                if (VsEnvironment != null)
                {
                    projectExplorer = new ProjectExplorer(VsEnvironment);
                }
            }
            catch (COMException ex)
            {
                //TODO: Log the COM Exception somewhere
                //Unable to attach to the current visual studio environment
                VsEnvironment = null;
            }

            return(projectExplorer);
        }
예제 #6
0
        public CompletionSessionManager(ICompletionBroker broker, IProjectExplorer projectExplorer, IWpfTextView textView, ITextStructureNavigator textNavigator)
        {
            if (broker == null)
            {
                throw new ArgumentNullException("broker", "Session Config is null.");
            }
            if (projectExplorer == null)
            {
                throw new ArgumentNullException("projectExplorer", "Project Explorer is null.");
            }
            if (textView == null)
            {
                throw new ArgumentNullException("textView", "Text View is null.");
            }
            if (textNavigator == null)
            {
                throw new ArgumentNullException("textNavigator", "textNavigator is null.");
            }

            _completionBroker = broker;
            _projectExplorer  = projectExplorer;
            _textView         = textView;
            _textNavigator    = textNavigator;
        }
예제 #7
0
 public void TearDown()
 {
     _mockProjectExplorer.VerifyAllExpectations();
     _mockProjectExplorer = null;
 }
예제 #8
0
 public void Setup()
 {
     _mockProjectExplorer = MockRepository.GenerateMock <IProjectExplorer>();
 }
예제 #9
0
 public void Setup()
 {
     _mockProjectExplorer = MockRepository.GenerateMock<IProjectExplorer>();
 }
예제 #10
0
 public void TearDown()
 {
     _mockProjectExplorer.VerifyAllExpectations();
     _mockProjectExplorer = null;
 }
예제 #11
0
 public CompletionSource(ITextBuffer textBuffer, IProjectExplorer projectExplorer)
 {
     _textBuffer = textBuffer;
     _projectExplorer = projectExplorer;
     _viewExplorer = new ViewExplorer(_projectExplorer);
 }
예제 #12
0
 public CompletionSource(ITextBuffer textBuffer, ITextStructureNavigator textNavigator, IProjectExplorer projectExplorer)
 {
     _textBuffer      = textBuffer;
     _textNavigator   = textNavigator;
     _projectExplorer = projectExplorer;
     _viewExplorer    = ViewExplorer.CreateFromActiveDocument(_projectExplorer);
 }