当前位置: 首页>>代码示例>>C#>>正文


C# IVsCodeWindow.GetSecondaryView方法代码示例

本文整理汇总了C#中IVsCodeWindow.GetSecondaryView方法的典型用法代码示例。如果您正苦于以下问题:C# IVsCodeWindow.GetSecondaryView方法的具体用法?C# IVsCodeWindow.GetSecondaryView怎么用?C# IVsCodeWindow.GetSecondaryView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IVsCodeWindow的用法示例。


在下文中一共展示了IVsCodeWindow.GetSecondaryView方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NavigationBarClient

        public NavigationBarClient(
            IVsDropdownBarManager manager,
            IVsCodeWindow codeWindow,
            IServiceProvider serviceProvider,
            VisualStudioWorkspaceImpl workspace)
        {
            _manager = manager;
            _codeWindow = codeWindow;
            _workspace = workspace;
            _imageService = (IVsImageService2)serviceProvider.GetService(typeof(SVsImageService));
            _projectItems = SpecializedCollections.EmptyList<NavigationBarProjectItem>();
            _currentTypeItems = SpecializedCollections.EmptyList<NavigationBarItem>();

            var vsShell = serviceProvider.GetService(typeof(SVsShell)) as IVsShell;
            if (vsShell != null)
            {
                object varImageList;
                int hresult = vsShell.GetProperty((int)__VSSPROPID.VSSPROPID_ObjectMgrTypesImgList, out varImageList);
                if (ErrorHandler.Succeeded(hresult) && varImageList != null)
                {
                    _imageList = (IntPtr)(int)varImageList;
                }
            }

            _codeWindowEventsSink = ComEventSink.Advise<IVsCodeWindowEvents>(codeWindow, this);
            _editorAdaptersFactoryService = serviceProvider.GetMefService<IVsEditorAdaptersFactoryService>();

            IVsTextView pTextView;
            codeWindow.GetPrimaryView(out pTextView);
            StartTrackingView(pTextView);

            pTextView = null;
            codeWindow.GetSecondaryView(out pTextView);
            StartTrackingView(pTextView);
        }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:35,代码来源:NavigationBarClient.cs

示例2: EditorNavigationDropdownBarClient

        public EditorNavigationDropdownBarClient(IVsCodeWindow codeWindow, IVsEditorAdaptersFactoryService editorAdaptersFactory, EditorNavigationSource source, IBufferGraphFactoryService bufferGraphFactoryService)
        {
            _codeWindow = codeWindow;
            _editorAdaptersFactory = editorAdaptersFactory;
            _source = source;
            _bufferGraphFactoryService = bufferGraphFactoryService;
            _currentTextView = editorAdaptersFactory.GetWpfTextView(codeWindow.GetLastActiveView());
            _dispatcher = _currentTextView.VisualElement.Dispatcher;
            _imageList = new ImageList
            {
                ColorDepth = ColorDepth.Depth32Bit
            };

            var connectionPointContainer = codeWindow as IConnectionPointContainer;
            if (connectionPointContainer != null)
            {
                var textViewEventsGuid = typeof(IVsCodeWindowEvents).GUID;
                IConnectionPoint connectionPoint;
                connectionPointContainer.FindConnectionPoint(ref textViewEventsGuid, out connectionPoint);
                connectionPoint?.Advise(this, out _codeWindowEventsCookie);
            }

            var primaryView = codeWindow.GetPrimaryView();
            if (primaryView != null)
                ((IVsCodeWindowEvents)this).OnNewView(primaryView);

            var secondaryView = codeWindow.GetSecondaryView();
            if (secondaryView != null)
                ((IVsCodeWindowEvents)this).OnNewView(secondaryView);

            _navigationItems = new List<EditorTypeNavigationTarget>();

            source.NavigationTargetsChanged += OnNavigationTargetsChanged;
            UpdateNavigationTargets();

            _currentTextView.Caret.PositionChanged += OnCaretPositionChanged;
        }
开发者ID:pminiszewski,项目名称:HlslTools,代码行数:37,代码来源:EditorNavigationDropdownBarClient.cs

示例3: DropdownBarClient

        public DropdownBarClient(
            ITextBuffer textBuffer,
            IVsDropdownBarManager manager,
            IVsCodeWindow codeWindow,            
            IServiceProvider serviceProvider): base(textBuffer) {

            Logger.Trace($"{nameof(DropdownBarClient)}:Ctor");

            _manager          = manager;
            _codeWindow       = codeWindow;
            _serviceProvider  = serviceProvider;
            _projectItems     = ImmutableList<NavigationItem>.Empty;
            _taskItems        = ImmutableList<NavigationItem>.Empty;
            _dispatcher       = Dispatcher.CurrentDispatcher;
            _activeSelections = new Dictionary<int, int>();
            _focusedCombo     = -1;
            _trackedViews     = new Dictionary<IVsTextView, IWpfTextView>();

            _workspaceRegistration = Workspace.GetWorkspaceRegistration(TextBuffer.AsTextContainer());
            _workspaceRegistration.WorkspaceChanged += OnWorkspaceRegistrationChanged;
            VSColorTheme.ThemeChanged += OnThemeChanged;

            var componentModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel));
            _editorAdaptersFactoryService=componentModel.GetService<IVsEditorAdaptersFactoryService>();

            _comEventSink = ComEventSink.Advise<IVsCodeWindowEvents>(codeWindow, this);

            IVsTextView pTextView;
            codeWindow.GetPrimaryView(out pTextView);            
            ConnectView(pTextView);

            codeWindow.GetSecondaryView(out pTextView);
            ConnectView(pTextView);

            ConnectToWorkspace(_workspaceRegistration.Workspace);

            UpdateImageList();
        }
开发者ID:IInspectable,项目名称:Nav.Language.Extensions,代码行数:38,代码来源:DropdownBarClient.cs

示例4: EditorNavigationDropdownBar

        public EditorNavigationDropdownBar(IVsCodeWindow codeWindow, IVsEditorAdaptersFactoryService editorAdaptersFactory, IEnumerable<IEditorNavigationSource> sources, IBufferGraphFactoryService bufferGraphFactoryService, IJavaEditorNavigationTypeRegistryService editorNavigationTypeRegistryService)
        {
            Contract.Requires<ArgumentNullException>(codeWindow != null, "codeWindow");
            Contract.Requires<ArgumentNullException>(editorAdaptersFactory != null, "editorAdaptersFactory");
            Contract.Requires<ArgumentNullException>(sources != null, "sources");
            Contract.Requires<ArgumentNullException>(bufferGraphFactoryService != null, "bufferGraphFactoryService");
            Contract.Requires<ArgumentNullException>(editorNavigationTypeRegistryService != null, "editorNavigationTypeRegistryService");

            this._codeWindow = codeWindow;
            this._editorAdaptersFactory = editorAdaptersFactory;
            this._sources = sources;
            this._bufferGraphFactoryService = bufferGraphFactoryService;
            this._editorNavigationTypeRegistryService = editorNavigationTypeRegistryService;
            this._currentTextView = editorAdaptersFactory.GetWpfTextView(codeWindow.GetLastActiveView());
            this._dispatcher = this._currentTextView.VisualElement.Dispatcher;
            this._imageList = new ImageList()
                {
                    ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit
                };

            _navigationControls =
                this._sources
                .SelectMany(source => source.GetNavigationTypes())
                .Distinct()
                //.OrderBy(...)
                .Select(type => Tuple.Create(type, new List<IEditorNavigationTarget>()))
                .ToArray();

            _selectedItem = new IEditorNavigationTarget[_navigationControls.Length];

            if (this._navigationControls.Length == 0)
            {
                return;
            }

            IConnectionPointContainer connectionPointContainer = codeWindow as IConnectionPointContainer;
            if (connectionPointContainer != null)
            {
                Guid textViewEventsGuid = typeof(IVsCodeWindowEvents).GUID;
                IConnectionPoint connectionPoint;
                connectionPointContainer.FindConnectionPoint(ref textViewEventsGuid, out connectionPoint);
                if (connectionPoint != null)
                    connectionPoint.Advise(this, out _codeWindowEventsCookie);
            }

            IVsTextView primaryView = codeWindow.GetPrimaryView();
            if (primaryView != null)
                ((IVsCodeWindowEvents)this).OnNewView(primaryView);

            IVsTextView secondaryView = codeWindow.GetSecondaryView();
            if (secondaryView != null)
                ((IVsCodeWindowEvents)this).OnNewView(secondaryView);

            foreach (var source in this._sources)
            {
                source.NavigationTargetsChanged += WeakEvents.AsWeak(OnNavigationTargetsChanged, eh => source.NavigationTargetsChanged -= eh);
                UpdateNavigationTargets(source);
            }

            _currentTextView.Caret.PositionChanged += OnCaretPositionChanged;
        }
开发者ID:Kav2018,项目名称:JavaForVS,代码行数:61,代码来源:EditorNavigationDropdownBar.cs


注:本文中的IVsCodeWindow.GetSecondaryView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。