コード例 #1
0
        private static void InvokeCommand(ToolbarCommand toolbarCommand)
        {
            var menuItemCmd = new CommandID(PackageConstants.GuidTortoiseGitToolbarCmdSet, (int)toolbarCommand);

            using (var dialogboxPurger = new DialogBoxPurger(NativeMethods.IDOK, 1))
            {
                dialogboxPurger.Start();

                ExecuteCommand(menuItemCmd);
            }
        }
コード例 #2
0
ファイル: Misc.cs プロジェクト: dbremner/nupattern
        public void WhenShowingMessage_ThenSucceeds()
        {
            var components = (IComponentModel)Package.GetGlobalService(typeof(SComponentModel));
            var service    = (IServiceProvider)components.GetService <SVsServiceProvider>();
            var ui         = (IVsUIShell)service.GetService(typeof(SVsUIShell));

            Assert.NotNull(service);
            Assert.NotNull(ui);

            using (var purger = new DialogBoxPurger(0))
            {
                UIThreadInvoker.Invoke((Action)(() =>
                {
                    PackageUtility.ShowError(service, "Foo", string.Empty);
                }));
            }
        }
コード例 #3
0
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate() {
                CommandID menuItemCmd = new CommandID(Company.VisualStudioHaskell.GuidList.guidVisualStudioHaskellCmdSet, (int)Company.VisualStudioHaskell.PkgCmdIDList.cmdidMyCommand);

                // Create the DialogBoxListener Thread.
                string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "VisualStudioHaskell", "Company.VisualStudioHaskell.VisualStudioHaskellPackage");
                DialogBoxPurger purger       = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);

                try {
                    purger.Start();

                    TestUtils testUtils = new TestUtils();
                    testUtils.ExecuteCommand(menuItemCmd);
                } finally {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }
        public void ShowConfigurationTest()
        {
            UIThreadInvoker.Invoke(new Action(() =>
            {
                var dialogBoxPurger = new DialogBoxPurger(NativeMethods.IDOK);

                try
                {
                    dialogBoxPurger.Start();

                    var configurationCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidOptions);
                    TestUtils.ExecuteCommand(configurationCommand);
                }
                finally
                {
                    dialogBoxPurger.WaitForDialogThreadToTerminate();
                }
            }));
        }
コード例 #5
0
        public void ShowConfigurationTest()
        {
            UIThreadInvoker.Invoke(new Action(() =>
            {
                var dialogBoxPurger = new DialogBoxPurger(NativeMethods.IDOK);

                try
                {
                    dialogBoxPurger.Start();

                    var configurationCommand = new CommandID(GuidList.GuidCodeMaidCommandConfiguration, (int)PkgCmdIDList.CmdIDCodeMaidConfiguration);
                    TestUtils.ExecuteCommand(configurationCommand);
                }
                finally
                {
                    dialogBoxPurger.WaitForDialogThreadToTerminate();
                }
            }));
        }
コード例 #6
0
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate() {
                var menuItemCmd = new CommandID(GuidList.guidShowMyGitBranchCmdSet, (int)PkgCmdIDList.cmdidFirstCommand);

                // Create the DialogBoxListener Thread.
                var expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "ShowMyGitBranch", "ThiagoSa.ShowMyGitBranch.ShowMyGitBranchPackage");
                var purger = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);

                try {
                    purger.Start();

                    var testUtils = new TestUtils();
                    testUtils.ExecuteCommand(menuItemCmd);
                }
                finally {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }
コード例 #7
0
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                var menuItemCmd = new CommandID(FSharpVSPowerTools.Constants.guidStandardCmdSet,
                                                (int)FSharpVSPowerTools.Constants.cmdidStandardRenameCommand);
                // Create the DialogBoxListener Thread.
                var expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "PowerToolsCommandsPackage", "FSharpVSPowerTools.PowerToolsCommandsPackage");
                var purger = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);

                try
                {
                    purger.Start();
                    TestUtils.ExecuteCommand(menuItemCmd);
                }
                finally
                {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }
コード例 #8
0
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                CommandID menuItemCmd = new CommandID(GeoCybernetica.CodeGenerationExtention.GuidList.guidCodeGenerationExtentionCmdSet, (int)GeoCybernetica.CodeGenerationExtention.PkgCmdIDList.showAllCommands);

                // Create the DialogBoxListener Thread.
                string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "CodeGenerationExtention", "GeoCybernetica.CodeGenerationExtention.CodeGenerationExtentionPackage");
                DialogBoxPurger purger       = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);

                try
                {
                    purger.Start();

                    TestUtils testUtils = new TestUtils();
                    testUtils.ExecuteCommand(menuItemCmd);
                }
                finally
                {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }
コード例 #9
0
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                CommandID menuItemCmd = new CommandID(SmartPaster2013.GuidList.guidSmartPaster2013CmdSet, (int)SmartPaster2013.PkgCmdIDList.cmdidPasteAsComment);

                // Create the DialogBoxListener Thread.
                string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "SmartPaster2013", "MartinWilley.SmartPaster2013.SmartPaster2013Package");
                DialogBoxPurger purger       = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);

                try
                {
                    purger.Start();

                    TestUtils testUtils = new TestUtils();
                    testUtils.ExecuteCommand(menuItemCmd);
                }
                finally
                {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }
コード例 #10
0
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                CommandID menuItemCmd = new CommandID(KittyAltruistic.CPlusPlusTestRunner.GuidList.GUIDTestPackageCmdSet, (int)KittyAltruistic.CPlusPlusTestRunner.PkgCmdIDList.cmdTestSettings);

                // Create the DialogBoxListener Thread.
                string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "GTest", "KittyAltruistic.CPlusPlusGTest.TestPackage");
                DialogBoxPurger purger       = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);

                try
                {
                    purger.Start();

                    TestUtils testUtils = new TestUtils();
                    testUtils.ExecuteCommand(menuItemCmd);
                }
                finally
                {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }
コード例 #11
0
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                CommandID menuItemCmd = new CommandID(Chambersoft.DapperFactory.GuidList.guidDapperFactoryCmdSet, (int)Chambersoft.DapperFactory.PkgCmdIDList.dfGenerateServiceInterfaces);

                // Create the DialogBoxListener Thread.
                string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "DapperFactory", "Chambersoft.DapperFactory.DapperFactoryPackage");
                DialogBoxPurger purger       = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);

                try
                {
                    purger.Start();

                    TestUtils testUtils = new TestUtils();
                    testUtils.ExecuteCommand(menuItemCmd);
                }
                finally
                {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }
コード例 #12
0
ファイル: MenuItemTest.cs プロジェクト: ZinkoSoft/NuSet
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                CommandID menuItemCmd = new CommandID(ZinkoSoft.NuSet.GuidList.NuSetCommandGuid, (int)ZinkoSoft.NuSet.PkgCmdIDList.nusetCommand);

                // Create the DialogBoxListener Thread.
                string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "NuSet", "ZinkoSoft.NuSet.NuSetPackage");
                DialogBoxPurger purger       = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);

                try
                {
                    purger.Start();

                    TestUtils testUtils = new TestUtils();
                    testUtils.ExecuteCommand(menuItemCmd);
                }
                finally
                {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }
コード例 #13
0
ファイル: MenuItemTest.cs プロジェクト: yidane/ServiceStackVS
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                CommandID menuItemCmd = new CommandID(ServiceStackVS.GuidList.guidVSServiceStackCmdSet, (int)ServiceStackVS.PkgCmdIDList.cmdidCSharpAddServiceStackReference);

                // Create the DialogBoxListener Thread.
                string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "ServiceStackVS", "ServiceStack.ServiceStackVS.ServiceStackVSPackage");
                DialogBoxPurger purger       = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);

                try
                {
                    purger.Start();

                    TestUtils testUtils = new TestUtils();
                    testUtils.ExecuteCommand(menuItemCmd);
                }
                finally
                {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }
コード例 #14
0
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                CommandID menuItemCmd = new CommandID(Nessos.CustomFsi.Vs2012.GuidList.guidVsPluginCmdSet, (int)Nessos.CustomFsi.Vs2012.PkgCmdIDList.customFsiCommand);

                // Create the DialogBoxListener Thread.
                string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "CustomFsi", "Nessos.CustomFsi.Vs2012.VsPluginPackage");
                DialogBoxPurger purger       = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);

                try
                {
                    purger.Start();

                    TestUtils testUtils = new TestUtils();
                    testUtils.ExecuteCommand(menuItemCmd);
                }
                finally
                {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }
コード例 #15
0
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                CommandID menuItemCmd = new CommandID(MicrosoftCorporation.SlowCheetah.GuidList.guidSlowCheetahCmdSet, (int)MicrosoftCorporation.SlowCheetah.PkgCmdIDList.cmdidAddTransform);

                // Create the DialogBoxListener Thread.
                string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "SlowCheetah", "MicrosoftCorporation.SlowCheetah.SlowCheetahPackage");
                DialogBoxPurger purger       = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);

                try
                {
                    purger.Start();

                    TestUtils testUtils = new TestUtils();
                    testUtils.ExecuteCommand(menuItemCmd);
                }
                finally
                {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }
コード例 #16
0
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                CommandID menuItemCmd = new CommandID(JosePedroSilva.TFSScrumExtensions.GuidList.guidTFSScrumExtensionsCmdSet, (int)JosePedroSilva.TFSScrumExtensions.PkgCmdIDList.cmdPlanWorkItem);

                // Create the DialogBoxListener Thread.
                string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "TFSScrumExtensions", "JosePedroSilva.TFSScrumExtensions.TFSScrumExtensionsPackage");
                DialogBoxPurger purger       = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);

                try
                {
                    purger.Start();

                    TestUtils testUtils = new TestUtils();
                    testUtils.ExecuteCommand(menuItemCmd);
                }
                finally
                {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }
コード例 #17
0
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                CommandID menuItemCmd = new CommandID(Digiexnet.VSGithubConnectorPkg.GuidList.guidVSGithubConnectorPkgCmdSet, (int)Digiexnet.VSGithubConnectorPkg.PkgCmdIDList.githubIssuesCmd);

                // Create the DialogBoxListener Thread.
                string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "VSGithubConnectorPkg", "Digiexnet.VSGithubConnectorPkg.VSGithubConnectorPkgPackage");
                DialogBoxPurger purger       = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);

                try
                {
                    purger.Start();

                    TestUtils testUtils = new TestUtils();
                    testUtils.ExecuteCommand(menuItemCmd);
                }
                finally
                {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }
コード例 #18
0
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                CommandID menuItemCmd = new CommandID(F1SYS.VsGitToolsPackage.GuidList.guidVsGitToolsPackageCmdSet, (int)F1SYS.VsGitToolsPackage.PkgCmdIDList.icmdSccCommandGitBash);

                // Create the DialogBoxListener Thread.
                string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "Git Tools", "F1SYS.VsGitToolsPackage.VsGitToolsPackagePackage");
                DialogBoxPurger purger       = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);

                try
                {
                    purger.Start();

                    TestUtils testUtils = new TestUtils();
                    testUtils.ExecuteCommand(menuItemCmd);
                }
                finally
                {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }
コード例 #19
0
ファイル: MenuItemTest.cs プロジェクト: watsug/Boo-Plugin
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                CommandID menuItemCmd = new CommandID(Hill30.BooProject.Constants.GuidBooProjectCmdSet, (int)PkgCmdIDList.cmdidBooISh);

                // Create the DialogBoxListener Thread.
                string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "BooProject", "Hill30.BooProject.BooProjectPackage");
                DialogBoxPurger purger       = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);

                try
                {
                    purger.Start();

                    TestUtils testUtils = new TestUtils();
                    testUtils.ExecuteCommand(menuItemCmd);
                }
                finally
                {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }
コード例 #20
0
        [TestMethod, Ignore] // show Dialog
        //[HostType("VS IDE")]
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                CommandID menuItemCmd = new CommandID(AnkhId.CommandSetGuid, (int)AnkhCommand.Checkout);

                // Create the DialogBoxListener Thread.
                string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "AnkhSvn", "AnkhSvn.AnkhSvn.AnkhSvnPackage");
                DialogBoxPurger purger       = new DialogBoxPurger(NativeMethods.IDCANCEL, expectedDialogBoxText);

                try
                {
                    purger.Start();

                    TestUtils testUtils = new TestUtils();
                    testUtils.ExecuteCommand(menuItemCmd);
                }
                finally
                {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }
コード例 #21
0
        public void LaunchCommand()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                CommandID menuItemCmd = new CommandID(McKearney.TfsSolutionInfo.GuidList.guidTfsProjectInfoCmdSet, (int)McKearney.TfsSolutionInfo.PkgCmdIDList.cmdidTfsProjectInfoSettings);

                // Create the DialogBoxListener Thread.
                string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "TfsProjectInfo", "McKearney.TfsSolutionInfo.TfsProjectInfoPackage");
                DialogBoxPurger purger       = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);

                try
                {
                    purger.Start();

                    TestUtils testUtils = new TestUtils();
                    testUtils.ExecuteCommand(menuItemCmd);
                }
                finally
                {
                    Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
                }
            });
        }