• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IVsWindowFrame类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IVsWindowFrame的典型用法代码示例。如果您正苦于以下问题:C# IVsWindowFrame类的具体用法?C# IVsWindowFrame怎么用?C# IVsWindowFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IVsWindowFrame类属于命名空间,在下文中一共展示了IVsWindowFrame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Open

 public override int Open(ref Guid logicalView, IntPtr docDataExisting, out IVsWindowFrame windowFrame,
     WindowFrameShowAction windowFrameAction)
 {
     var editorGuid = VSConstants.GUID_ProjectDesignerEditor;
     return OpenWithSpecific(0, ref editorGuid, string.Empty, ref logicalView, docDataExisting, out windowFrame,
         windowFrameAction);
 }
开发者ID:mimura1133,项目名称:vstex,代码行数:7,代码来源:ProjectDesignerDocumentManager.cs


示例2: OnBeforeDocumentWindowShow

    public int OnBeforeDocumentWindowShow(uint docCookie, int fFirstShow, IVsWindowFrame frame)
    {
      ThreadHelper.ThrowIfNotOnUIThread();

      if (fFirstShow != 0)
      {
        var windowFrameInfo = new WindowFrameInfo(frame, this);
        _windowFrames.Add(frame, windowFrameInfo);
      }

      //var path = frame.GetFilePath();
      //int isOnScreen;
      //frame.IsOnScreen(out isOnScreen);
      //Debug.WriteLine($"tr: BeforeDocumentWindowShow(docCookie={docCookie}, fFirstShow='{fFirstShow != 0}', isOnScreen={isOnScreen}, path='{path}')");


      //if (_activeFrames.Count == 0 || _activeFrames[0] != frame)
      //{
      //  _activeFrames.Remove(frame);
      //  _activeFrames.Insert(0, frame);
      //}
      //
      // посылаем сообщение активации
      return VSConstants.S_OK;
    }
开发者ID:rsdn,项目名称:nitra,代码行数:25,代码来源:RunningDocTableEvents.cs


示例3: GetToolWindowData

        /// <summary>
        /// Retrieves captions and positions of all active tool windows
        /// </summary>
        /// <returns></returns>
        public static IEnumerable<ToolWindowData> GetToolWindowData(IVsUIShell shell) {
            var data = new List<ToolWindowData>();
            try {
                IEnumWindowFrames e;
                shell.GetToolWindowEnum(out e);

                IVsWindowFrame[] frame = new IVsWindowFrame[1];
                uint fetched = 0;
                while (VSConstants.S_OK == e.Next(1, frame, out fetched) && fetched > 0) {
                    object objCaption;
                    frame[0].GetProperty((int)__VSFPROPID.VSFPROPID_Caption, out objCaption);

                    VSSETFRAMEPOS[] pos = new VSSETFRAMEPOS[1];
                    Guid relative;
                    int x, y, cx, cy;
                    frame[0].GetFramePos(pos, out relative, out x, out y, out cx, out cy);

                    var d = new ToolWindowData() {
                        Caption = objCaption as string,
                        X = x,
                        Y = y,
                        Width = cx,
                        Height = cy
                    };

                    data.Add(d);
                }
            } catch (Exception) { }

            return data;
        }
开发者ID:AlexanderSher,项目名称:RTVS-Old,代码行数:35,代码来源:ToolWindowData.cs


示例4: ShowSimpleOrmWindowSingleton

 private ShowSimpleOrmWindowSingleton(
     IVsWindowFrame vsWindowFrame,
     SimpleOrmMappingWindow simpleOrmMappingWindow)
 {
     _vsWindowFrame = vsWindowFrame;
     _simpleOrmMappingWindow = simpleOrmMappingWindow;
 }
开发者ID:thabart,项目名称:SimpleOrm,代码行数:7,代码来源:ShowSimpleOrmWindowSingleton.cs


示例5: ContainsImmediateWindow

        internal static bool ContainsImmediateWindow(this IEnumerable<IVsTextView> vsTextViews, IVsUIShell shellService, IVsEditorAdaptersFactoryService _editorAdaptersFactoryService)
        {
            IEnumWindowFrames windowEnum = null;
            Marshal.ThrowExceptionForHR(shellService.GetToolWindowEnum(out windowEnum));

            IVsWindowFrame[] frame = new IVsWindowFrame[1];
            uint value;

            var immediateWindowGuid = Guid.Parse(ToolWindowGuids80.ImmediateWindow);

            while (windowEnum.Next(1, frame, out value) == VSConstants.S_OK)
            {
                Guid toolWindowGuid;
                Marshal.ThrowExceptionForHR(frame[0].GetGuidProperty((int)__VSFPROPID.VSFPROPID_GuidPersistenceSlot, out toolWindowGuid));
                if (toolWindowGuid == immediateWindowGuid)
                {
                    IntPtr frameTextView;
                    Marshal.ThrowExceptionForHR(frame[0].QueryViewInterface(typeof(IVsTextView).GUID, out frameTextView));
                    try
                    {
                        var immediateWindowTextView = Marshal.GetObjectForIUnknown(frameTextView) as IVsTextView;
                        var immediateWindowWpfTextView = _editorAdaptersFactoryService.GetWpfTextView(immediateWindowTextView);
                        return vsTextViews.Any(vsTextView => _editorAdaptersFactoryService.GetWpfTextView(vsTextView) == immediateWindowWpfTextView);
                    }
                    finally
                    {
                        Marshal.Release(frameTextView);
                    }
                }
            }

            return false;
        }
开发者ID:JackWangCUMT,项目名称:roslyn,代码行数:33,代码来源:IVsTextViewExtensions.cs


示例6: OnAfterDocumentWindowHide

 public virtual int OnAfterDocumentWindowHide(
     uint docCookie,
     IVsWindowFrame pFrame
     )
 {
     return VSConstants.S_OK;
 }
开发者ID:speps,项目名称:local-history-visual-studio,代码行数:7,代码来源:IVsRunningDocTableEvents3Adapter.cs


示例7: OpenWithSpecific

        public override int OpenWithSpecific(uint editorFlags, ref Guid editorType, string physicalView, ref Guid logicalView, IntPtr docDataExisting, out IVsWindowFrame frame, WindowFrameShowAction windowFrameAction)
        {
            frame = null;
            Debug.Assert(editorType == VSConstants.GUID_ProjectDesignerEditor, "Cannot open project designer with guid " + editorType.ToString());

            if (this.Node == null || this.Node.ProjectMgr == null || this.Node.ProjectMgr.IsClosed)
            {
                return VSConstants.E_FAIL;
            }

            IVsUIShellOpenDocument uiShellOpenDocument = this.Node.ProjectMgr.Site.GetService(typeof(SVsUIShellOpenDocument)) as IVsUIShellOpenDocument;
            IOleServiceProvider serviceProvider = this.Node.ProjectMgr.Site.GetService(typeof(IOleServiceProvider)) as IOleServiceProvider;

            if (serviceProvider != null && uiShellOpenDocument != null)
            {
                string fullPath = this.GetFullPathForDocument();
                string caption = this.GetOwnerCaption();

                IVsUIHierarchy parentHierarchy = this.Node.ProjectMgr.GetProperty((int)__VSHPROPID.VSHPROPID_ParentHierarchy) as IVsUIHierarchy;

                IntPtr parentHierarchyItemId = (IntPtr)this.Node.ProjectMgr.GetProperty((int)__VSHPROPID.VSHPROPID_ParentHierarchyItemid);

                ErrorHandler.ThrowOnFailure(uiShellOpenDocument.OpenSpecificEditor(editorFlags, fullPath, ref editorType, physicalView, ref logicalView, caption, parentHierarchy, (uint)(parentHierarchyItemId.ToInt32()), docDataExisting, serviceProvider, out frame));

                if (frame != null)
                {
                    if (windowFrameAction == WindowFrameShowAction.Show)
                    {
                        ErrorHandler.ThrowOnFailure(frame.Show());
                    }
                }
            }

            return VSConstants.S_OK;
        }
开发者ID:Jeremiahf,项目名称:wix3,代码行数:35,代码来源:projectdesignerdocumentmanager.cs


示例8: OnBeforeDocumentWindowShow

        public int OnBeforeDocumentWindowShow(uint docCookie, int fFirstShow, IVsWindowFrame pFrame)
        {
            if( VSGestureService.Current.VSGestureInfo.UserSettings.EnableVSGesture == false ) return VSConstants.S_OK;

            var win = VsShellUtilities.GetWindowObject(pFrame);
            if( win == null ) return VSConstants.S_OK;

            var view = VsShellUtilities.GetTextView(pFrame);
            if( view == null ) return VSConstants.S_OK;

            IDesignerHost host = win.Object as IDesignerHost;

            var handler = view.GetWindowHandle();

            var hwnd = handler;
            if (list.ContainsKey(hwnd) == true) return VSConstants.S_OK;

            GestureNativeWindow window = new GestureNativeWindow(hwnd);
            list.Add(hwnd, window);

            if (VSGestureService.Current.VSGestureInfo.UserSettings.EnableVSGestureAlram == true)
            {
                // Welcome 메시지
                VSGesture.Controls.frmWelcome frm = new Umc.Core.Tools.VSGesture.Controls.frmWelcome();
                frm.ShowInTaskbar = false;
                frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
                frm.Show();

                VSGestureService.Current.VSGestureInfo.UserSettings.EnableVSGestureAlram = false;
                VSGestureService.Current.VSGestureInfo = VSGestureService.Current.VSGestureInfo;
            }

            return VSConstants.S_OK;
        }
开发者ID:powerumc,项目名称:vsgesture,代码行数:34,代码来源:RunningDocEventImpl.cs


示例9: OpenWithSpecific

 /// <summary>
 /// Open a file with a specific editor
 /// </summary>
 /// <param name="editorFlags">Specifies actions to take when opening a specific editor. Possible editor flags are defined in the enumeration Microsoft.VisualStudio.Shell.Interop.__VSOSPEFLAGS</param>
 /// <param name="editorType">Unique identifier of the editor type</param>
 /// <param name="physicalView">Name of the physical view. If null, the environment calls MapLogicalView on the editor factory to determine the physical view that corresponds to the logical view. In this case, null does not specify the primary view, but rather indicates that you do not know which view corresponds to the logical view</param>
 /// <param name="logicalView">In MultiView case determines view to be activated by IVsMultiViewDocumentView. For a list of logical view GUIDS, see constants starting with LOGVIEWID_ defined in NativeMethods class</param>
 /// <param name="docDataExisting">IntPtr to the IUnknown interface of the existing document data object</param>
 /// <param name="windowFrame">A reference to the window frame that is mapped to the file</param>
 /// <param name="windowFrameAction">Determine the UI action on the document window</param>
 /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns>
 public override int OpenWithSpecific(uint editorFlags, ref Guid editorType, string physicalView, ref Guid logicalView, IntPtr docDataExisting, out IVsWindowFrame windowFrame, WindowFrameShowAction windowFrameAction)
 {
     windowFrame = null;
     bool newFile = false;
     bool openWith = false;
     return this.Open(newFile, openWith, editorFlags, ref editorType, physicalView, ref logicalView, docDataExisting, out windowFrame, windowFrameAction);
 }
开发者ID:xenocons,项目名称:visualfsharp,代码行数:18,代码来源:FileDocumentManager.cs


示例10: OnBeforeDocumentWindowShow

 protected override void OnBeforeDocumentWindowShow(IVsWindowFrame frame, DocumentId id, bool firstShow)
 {
     if (_documentTrackingService != null)
     {
         _documentTrackingService.DocumentFrameShowing(frame, id, firstShow);
     }
 }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:7,代码来源:RoslynDocumentProvider.cs


示例11: GetVsTextView

        private static IVsTextView GetVsTextView(IVsWindowFrame windowFrame)
        {
            Validate.IsNotNull(windowFrame, nameof(windowFrame));

            object docView;
            int hresult = windowFrame.GetProperty((int)__VSFPROPID.VSFPROPID_DocView, out docView);

            if (ErrorHandler.Failed(hresult))
            {
                return null;
            }

            IVsTextView viewAdapter = docView as IVsTextView;

            if (viewAdapter != null)
            {
                return viewAdapter;
            }

            IVsCodeWindow codeWindow = docView as IVsCodeWindow;

            if (codeWindow != null)
            {
                IVsTextView codeView;

                if (ErrorHandler.Succeeded(codeWindow.GetPrimaryView(out codeView)) && codeView != null)
                {
                    return codeView;
                }
            }

            return null;
        }
开发者ID:Strongc,项目名称:VSLua,代码行数:33,代码来源:DocumentOperations.cs


示例12: CreateInfoBar

        private void CreateInfoBar(IVsInfoBarUIFactory factory, IVsWindowFrame frame, string message, ErrorReportingUI[] items)
        {
            if (ErrorHandler.Failed(frame.GetProperty((int)__VSFPROPID7.VSFPROPID_InfoBarHost, out var unknown)))
            {
                return;
            }

            var textSpans = new List<IVsInfoBarTextSpan>()
            {
                new InfoBarTextSpan(message)
            };

            // create action item list
            var actionItems = new List<IVsInfoBarActionItem>();

            foreach (var item in items)
            {
                switch (item.Kind)
                {
                    case ErrorReportingUI.UIKind.Button:
                        actionItems.Add(new InfoBarButton(item.Title));
                        break;
                    case ErrorReportingUI.UIKind.HyperLink:
                        actionItems.Add(new InfoBarHyperlink(item.Title));
                        break;
                    case ErrorReportingUI.UIKind.Close:
                        break;
                    default:
                        throw ExceptionUtilities.UnexpectedValue(item.Kind);
                }
            }

            var infoBarModel = new InfoBarModel(
                textSpans,
                actionItems.ToArray(),
                KnownMonikers.StatusInformation,
                isCloseButtonVisible: true);
            if (!TryCreateInfoBarUI(factory, infoBarModel, out var infoBarUI))
            {
                return;
            }

            uint? infoBarCookie = null;
            var eventSink = new InfoBarEvents(items, () =>
            {
                // run given onClose action if there is one.
                items.FirstOrDefault(i => i.Kind == ErrorReportingUI.UIKind.Close).Action?.Invoke();

                if (infoBarCookie.HasValue)
                {
                    infoBarUI.Unadvise(infoBarCookie.Value);
                }
            });
            infoBarUI.Advise(eventSink, out var cookie);
            infoBarCookie = cookie;

            var host = (IVsInfoBarHost)unknown;
            host.AddInfoBar(infoBarUI);
        }
开发者ID:GuilhermeSa,项目名称:roslyn,代码行数:59,代码来源:VisualStudioErrorReportingService.cs


示例13: OnBeforeDocumentWindowShow

 public virtual int OnBeforeDocumentWindowShow(
     uint docCookie,
     int fFirstShow,
     IVsWindowFrame pFrame
     )
 {
     return VSConstants.S_OK;
 }
开发者ID:speps,项目名称:local-history-visual-studio,代码行数:8,代码来源:IVsRunningDocTableEvents3Adapter.cs


示例14: OnBeforeDocumentWindowShow

 public int OnBeforeDocumentWindowShow(uint docCookie, int fFirstShow, IVsWindowFrame pFrame)
 {
     if (OnBeforeDocumentWindowShowEvent != null)
     {
         OnBeforeDocumentWindowShowEvent(docCookie,fFirstShow,pFrame);
     }
     return VSConstants.S_OK;
 }
开发者ID:qianlifeng,项目名称:easyvsx,代码行数:8,代码来源:RunningDocTableEventSink.cs


示例15: UDNDocView

        public UDNDocView(string sourceFilePath, IWpfTextView textEditorView, IVsWindowFrame windowFrame, MarkdownPackage package, IVsUIShell uiShell)
        {
            SourceFilePath = sourceFilePath;
            TextEditorView = textEditorView;
            WindowFrame = windowFrame;

            NavigateToComboData = new NavigateToComboData(textEditorView, uiShell);
            ParsingResultsCache = new UDNParsingResultsCache(package, sourceFilePath, textEditorView);
        }
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:9,代码来源:UDNDocView.cs


示例16: VisualStudioDocument

 internal VisualStudioDocument(IVsWindowFrame frame, IVsTextLines buffer, IOleServiceProvider docViewService)
 {
     this.textEditorBuffer = buffer;
     this.currentWindowFrame = frame;
     if (GetSource(docViewService))
     {
         LoadDocument();
     }
 }
开发者ID:zanyants,项目名称:mvp.xml,代码行数:9,代码来源:VisualStudioDocument.cs


示例17: LoadFilesIntoRepl

 public LoadFilesIntoRepl(
     ReplWriter writer,
     IProvider<List<string>> filesProvider,
     IVsWindowFrame replToolWindowFrame)
 {
     _writer = writer;
     _filesProvider = filesProvider;
     _replToolWindowFrame = replToolWindowFrame;
 }
开发者ID:rojepp,项目名称:vsClojure,代码行数:9,代码来源:LoadFilesIntoRepl.cs


示例18: GetTextView

        private ITextView GetTextView(IVsWindowFrame frame)
        {
            if (frame == null)
                return null;

            IVsTextView viewAdapter = VsShellUtilities.GetTextView(frame);
            IWpfTextView wpfTextView = this.VsEditorAdaptorsFactoryService.GetWpfTextView(viewAdapter);
            return wpfTextView;
        }
开发者ID:sebandraos,项目名称:LangSvcV2,代码行数:9,代码来源:MonitorSelectionService.cs


示例19:

        int IVsUIShell.FindToolWindow(uint grfFTW, ref Guid rguidPersistenceSlot, out IVsWindowFrame windowFrame)
        {
            windowFrame = null;
            if (this.FindToolWindowAction != null)
            {
                windowFrame = this.FindToolWindowAction(rguidPersistenceSlot);
            }

            return VSConstants.S_OK;
        }
开发者ID:SonarSource-VisualStudio,项目名称:sonarlint-visualstudio,代码行数:10,代码来源:StubVsUIShell.cs


示例20: GetWpfTextView

 private IWpfTextView GetWpfTextView(IVsWindowFrame frame) {
     IVsTextView textView = null;
     if (frame != null) {
         try {
             textView = VsShellUtilities.GetTextView(frame);
             // IDE occasionally throws 'not implemented' on close
         } catch (NotImplementedException) { }
     }
     return textView != null ?_editorAdaptersFactory.GetWpfTextView(textView) : null;
 }
开发者ID:Microsoft,项目名称:RTVS,代码行数:10,代码来源:ActiveWpfTextViewTracker.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IVwEnv类代码示例发布时间:2022-05-24
下一篇:
C# IVsTextView类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap