當前位置: 首頁>>代碼示例>>C#>>正文


C# PythonVisualStudioApp.LaunchPythonProfiling方法代碼示例

本文整理匯總了C#中TestUtilities.UI.Python.PythonVisualStudioApp.LaunchPythonProfiling方法的典型用法代碼示例。如果您正苦於以下問題:C# PythonVisualStudioApp.LaunchPythonProfiling方法的具體用法?C# PythonVisualStudioApp.LaunchPythonProfiling怎麽用?C# PythonVisualStudioApp.LaunchPythonProfiling使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TestUtilities.UI.Python.PythonVisualStudioApp的用法示例。


在下文中一共展示了PythonVisualStudioApp.LaunchPythonProfiling方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: LaunchPythonProfilingWizard

        public void LaunchPythonProfilingWizard() {
            using (var app = new PythonVisualStudioApp()) {
                var project = app.OpenProject(@"TestData\ProfileTest.sln");

                using (var perfTarget = app.LaunchPythonProfiling()) {
                    perfTarget.SelectProfileProject();

                    perfTarget.SelectedProjectComboBox.SelectItem("HelloWorld");

                    try {
                        perfTarget.Ok();
                    } catch (ElementNotEnabledException) {
                        Assert.Fail("Settings were invalid:\n  SelectedProject = {0}",
                            perfTarget.SelectedProjectComboBox.GetSelectedItemName());
                    }
                }
                app.WaitForDialogDismissed();

                var profiling = (IPythonProfiling)app.Dte.GetObject("PythonProfiling");
                var session = profiling.GetSession(1);

                Assert.IsNotNull(app.PythonPerformanceExplorerTreeView.WaitForItem("HelloWorld *"));

                while (profiling.IsProfiling) {
                    // wait for profiling to finish...
                    Thread.Sleep(100);
                }
            }
        }
開發者ID:wenh123,項目名稱:PTVS,代碼行數:29,代碼來源:ProfilingTests.cs

示例2: DefaultInterpreterSelected

        public void DefaultInterpreterSelected() {
            using (var app = new PythonVisualStudioApp()) {
                var service = app.InterpreterService;
                var originalDefault = service.DefaultInterpreter;

                try {
                    foreach (var interpreter in service.Interpreters) {
                        service.DefaultInterpreter = interpreter;
                        using (var dialog = app.LaunchPythonProfiling()) {
                            Assert.AreEqual(interpreter.Description, dialog.SelectedInterpreter);
                        }
                        app.WaitForDialogDismissed();
                    }
                } finally {
                    service.DefaultInterpreter = originalDefault;
                }
            }
        }
開發者ID:wenh123,項目名稱:PTVS,代碼行數:18,代碼來源:ProfilingTests.cs

示例3: StartupProjectSelected

        public void StartupProjectSelected() {
            using (var app = new PythonVisualStudioApp()) {
                app.OpenProject(TestData.GetPath(@"TestData\MultiProjectAnalysis\MultiProjectAnalysis.sln"));

                foreach (var project in app.Dte.Solution.Projects.Cast<EnvDTE.Project>()) {
                    var tree = app.OpenSolutionExplorer();
                    var item = tree.FindByName(project.Name);
                    item.Select();
                    app.Dte.ExecuteCommand("Project.SetasStartupProject");

                    using (var dialog = app.LaunchPythonProfiling()) {
                        Assert.AreEqual(project.Name, dialog.SelectedProject);
                    }
                    app.WaitForDialogDismissed();
                }
            }
        }
開發者ID:wenh123,項目名稱:PTVS,代碼行數:17,代碼來源:ProfilingTests.cs


注:本文中的TestUtilities.UI.Python.PythonVisualStudioApp.LaunchPythonProfiling方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。