public CSharpPathedDocumentExtension(ITextView view, JoinableTaskContext joinableTaskContext, Microsoft.VisualStudio.Text.Operations.IEditorOperations editorOperations)
        {
            textView = view;

            this.editorOperations = editorOperations;

            this.joinableTaskContext       = joinableTaskContext;
            textContainer                  = view.TextBuffer.AsTextContainer();
            registration                   = Microsoft.CodeAnalysis.Workspace.GetWorkspaceRegistration(textContainer);
            registration.WorkspaceChanged += WorkspaceChanged;

            CurrentPath = new PathEntry [] { new PathEntry(GettextCatalog.GetString("No selection"))
                                             {
                                                 Tag = null
                                             } };
            isPathSet = false;
            view.Caret.PositionChanged  += CaretPositionChanged;
            view.TextBuffer.PostChanged += TextBufferChanged;
        }
Exemplo n.º 2
0
        public CSharpPathedDocumentExtension(ITextView view, JoinableTaskContext joinableTaskContext, Microsoft.VisualStudio.Text.Operations.IEditorOperations editorOperations)
        {
            textView = view;

            this.editorOperations = editorOperations;

            this.joinableTaskContext       = joinableTaskContext;
            textContainer                  = view.TextBuffer.AsTextContainer();
            registration                   = Microsoft.CodeAnalysis.Workspace.GetWorkspaceRegistration(textContainer);
            registration.WorkspaceChanged += WorkspaceChanged;

            CurrentPath = new PathEntry [] { new PathEntry(GettextCatalog.GetString("No selection"))
                                             {
                                                 Tag = null
                                             } };
            isPathSet = false;
            view.Caret.PositionChanged  += CaretPositionChanged;
            view.TextBuffer.PostChanged += TextBufferChanged;

            // WorkspaceChanged event is not always fired so run the logic to update the owner projects to
            // ensure they are available in the path bar.
            WorkspaceChanged(null, null);
        }