Microsoft.VsSDK.IntegrationTestLibrary.TestUtils.CanFindToolwindow C# (CSharp) Method

CanFindToolwindow() public method

public CanFindToolwindow ( System.Guid persistenceGuid ) : bool
persistenceGuid System.Guid
return bool
        public bool CanFindToolwindow(Guid persistenceGuid)
        {
            IVsUIShell uiShellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsUIShell)) as IVsUIShell;
            Assert.IsNotNull(uiShellService);
            IVsWindowFrame windowFrame;
            int hr = uiShellService.FindToolWindow((uint)__VSFINDTOOLWIN.FTW_fFindFirst, ref persistenceGuid, out windowFrame);
            Assert.IsTrue(hr == VSConstants.S_OK);

            return (windowFrame != null);
        }

Usage Example

示例#1
0
        public void ShowToolWindow()
        {
            UIThreadInvoker.Invoke((ThreadInvoker)delegate()
            {
                CommandID toolWindowCmd = new CommandID(AttackPattern.VisualGit.GuidList.guidVisualGitCmdSet, (int)AttackPattern.VisualGit.PkgCmdIDList.cmdidGitWindow);

                TestUtils testUtils = new TestUtils();
                testUtils.ExecuteCommand(toolWindowCmd);

                Assert.IsTrue(testUtils.CanFindToolwindow(new Guid(AttackPattern.VisualGit.GuidList.guidToolWindowPersistanceString)));

            });
        }
All Usage Examples Of Microsoft.VsSDK.IntegrationTestLibrary.TestUtils::CanFindToolwindow