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


C# VisualStudioApp.FileNewProject方法代码示例

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


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

示例1: CreateProject

        internal static void CreateProject(VisualStudioApp app, string languageName, string templateName, string location, string projectName, string expectedProjectItem) {
            using (var newProjDialog = app.FileNewProject()) {
                newProjDialog.FocusLanguageNode(languageName);
                newProjDialog.Location = location;
                newProjDialog.ProjectName = projectName;

                var djangoApp = newProjDialog.ProjectTypes.FindItem(templateName);
                djangoApp.Select();
                newProjDialog.OK();
            }

            // wait for new solution to load...
            for (int i = 0; i < 40 && app.Dte.Solution.Projects.Count == 0; i++) {
                System.Threading.Thread.Sleep(250);
            }

            app.OpenSolutionExplorer().WaitForItem(
                "Solution '" + app.Dte.Solution.Projects.Item(1).Name + "' (1 project)",
                app.Dte.Solution.Projects.Item(1).Name,
                expectedProjectItem
            );
        }
开发者ID:lioaphy,项目名称:nodejstools,代码行数:22,代码来源:AzureWebSiteTests.cs

示例2: DeferredSaveWithDot

        public void DeferredSaveWithDot() {
            // http://pytools.codeplex.com/workitem/623
            // enable deferred saving on projects

            using (var app = new VisualStudioApp()) {
                var props = app.Dte.get_Properties("Environment", "ProjectsAndSolution");
                var prevValue = props.Item("SaveNewProjects").Value;
                props.Item("SaveNewProjects").Value = false;
                app.OnDispose(() => props.Item("SaveNewProjects").Value = prevValue);

                // now run the test
                var newProjDialog = app.FileNewProject();

                newProjDialog.FocusLanguageNode("JavaScript");

                var consoleApp = newProjDialog.ProjectTypes.FindItem("Blank Node.js Application");
                consoleApp.Select();
                newProjDialog.ProjectName = "Fob.Baz";
                newProjDialog.ClickOK();

                // wait for new solution to load...
                for (int i = 0; i < 100 && app.Dte.Solution.Projects.Count == 0; i++) {
                    System.Threading.Thread.Sleep(1000);
                }

                TestUtils.DteExecuteCommandOnThreadPool("File.SaveAll");

                var saveProjDialog = new SaveProjectDialog(app.WaitForDialog());
                saveProjDialog.Save();

                app.WaitForDialogDismissed();

                var fullname = app.Dte.Solution.FullName;
                app.Dte.Solution.Close(false);

                Directory.Delete(Path.GetDirectoryName(fullname), true);
            }
        }
开发者ID:paladique,项目名称:nodejstools,代码行数:38,代码来源:UITests.cs

示例3: TestNewProject

        public void TestNewProject()
        {
            using (var app = new VisualStudioApp()) {
                using (var newProjDialog = app.FileNewProject()) {
                    newProjDialog.FocusLanguageNode("JavaScript");
                    var nodejsApp = newProjDialog.ProjectTypes.FindItem("Basic Node.js Web Server (Universal Windows)");
                    nodejsApp.Select();

                    newProjDialog.OK();
                }

                // wait for new solution to load...
                for (int i = 0; i < 40 && app.Dte.Solution.Projects.Count == 0; i++) {
                    System.Threading.Thread.Sleep(250);
                }

                app.SolutionExplorerTreeView.WaitForItem(
                    "Solution '" + app.Dte.Solution.Projects.Item(1).Name + "' (1 project)",
                    app.Dte.Solution.Projects.Item(1).Name,
                    "server.js"
                );
            }
        }
开发者ID:munyirik,项目名称:ntvsiot,代码行数:23,代码来源:ProjectTests.cs

示例4: FromDte

 public static NewProjectDialog FromDte(VisualStudioApp app) {
     return app.FileNewProject();
 }
开发者ID:sramos30,项目名称:ntvsiot,代码行数:3,代码来源:NewItemDialog.cs


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