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


C# VisualStudioApp.CreateProject方法代码示例

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


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

示例1: CreateTemporaryProject

        private EnvDTE.Project CreateTemporaryProject(VisualStudioApp app) {
            var project = app.CreateProject(
                PythonVisualStudioApp.TemplateLanguageName,
                PythonVisualStudioApp.PythonApplicationTemplate,
                TestData.GetTempPath(),
                TestContext.TestName
            );

            Assert.IsNotNull(project, "Project was not created");
            return project;
        }
开发者ID:KaushikCh,项目名称:PTVS,代码行数:11,代码来源:VirtualEnvTests.cs

示例2: NewDjangoProject

 public void NewDjangoProject() {
     using (var app = new VisualStudioApp()) {
         var project = app.CreateProject(
             PythonVisualStudioApp.TemplateLanguageName,
             PythonVisualStudioApp.DjangoWebProjectTemplate,
             TestData.GetTempPath(),
             "NewDjangoProject"
         );
         var folder = project.ProjectItems.Item(project.Name);
         Assert.IsNotNull(project.ProjectItems.Item("manage.py"));
         Assert.IsNotNull(folder.ProjectItems.Item("settings.py"));
         Assert.IsNotNull(folder.ProjectItems.Item("urls.py"));
         Assert.IsNotNull(folder.ProjectItems.Item("__init__.py"));
         Assert.IsNotNull(folder.ProjectItems.Item("wsgi.py"));
     }
 }
开发者ID:smallwave,项目名称:PTVS,代码行数:16,代码来源:DjangoProjectTests.cs

示例3: NewDjangoProjectSafeProjectName

        public void NewDjangoProjectSafeProjectName() {
            using (var app = new VisualStudioApp()) {
                var project = app.CreateProject(
                    PythonVisualStudioApp.TemplateLanguageName,
                    PythonVisualStudioApp.DjangoWebProjectTemplate,
                    TestData.GetTempPath(),
                    "Django Project $100"
                );

                var folder = project.ProjectItems.Item("Django_Project__100");
                Assert.IsNotNull(project.ProjectItems.Item("manage.py"));
                Assert.IsNotNull(folder.ProjectItems.Item("settings.py"));
                Assert.IsNotNull(folder.ProjectItems.Item("urls.py"));
                Assert.IsNotNull(folder.ProjectItems.Item("__init__.py"));
                Assert.IsNotNull(folder.ProjectItems.Item("wsgi.py"));
                var settings = app.ServiceProvider.GetUIThread().Invoke(() => project.GetPythonProject().GetProperty("DjangoSettingsModule"));
                Assert.AreEqual("Django_Project__100.settings", settings);
            }
        }
开发者ID:smallwave,项目名称:PTVS,代码行数:19,代码来源:DjangoProjectTests.cs

示例4: StartNewAppSameAsProjectName

        public void StartNewAppSameAsProjectName() {
            using (var app = new VisualStudioApp()) {
                var project = app.CreateProject(
                    PythonVisualStudioApp.TemplateLanguageName,
                    PythonVisualStudioApp.DjangoWebProjectTemplate,
                    TestData.GetTempPath(),
                    "StartNewAppSameAsProjectName"
                );
                app.SolutionExplorerTreeView.SelectProject(project);

                using (var newAppDialog = NewAppDialog.FromDte(app)) {
                    newAppDialog.AppName = app.Dte.Solution.Projects.Item(1).Name;
                    newAppDialog.OK();
                }

                using (var dlg = AutomationDialog.WaitForDialog(app)) { }
            }
        }
开发者ID:smallwave,项目名称:PTVS,代码行数:18,代码来源:DjangoProjectTests.cs

示例5: StartNewAppDuplicateName

        public void StartNewAppDuplicateName() {
            using (var app = new VisualStudioApp()) {
                var project = app.CreateProject(
                    PythonVisualStudioApp.TemplateLanguageName,
                    PythonVisualStudioApp.DjangoWebProjectTemplate,
                    TestData.GetTempPath(),
                    "StartNewAppDuplicateName"
                );
                app.SolutionExplorerTreeView.SelectProject(project);

                using (var newAppDialog = NewAppDialog.FromDte(app)) {
                    newAppDialog.AppName = "Fob";
                    newAppDialog.OK();
                }

                app.SolutionExplorerTreeView.WaitForItem(
                    app.Dte.Solution.FullName,
                    app.Dte.Solution.Projects.Item(1).Name,
                    "Fob",
                    "models.py"
                );

                app.Dte.Documents.CloseAll(EnvDTE.vsSaveChanges.vsSaveChangesNo);

                app.SolutionExplorerTreeView.SelectProject(project);
                using (var newAppDialog = NewAppDialog.FromDte(app)) {
                    newAppDialog.AppName = "Fob";
                    newAppDialog.OK();
                }

                using (var dlg = AutomationDialog.WaitForDialog(app)) { }
            }
        }
开发者ID:smallwave,项目名称:PTVS,代码行数:33,代码来源:DjangoProjectTests.cs


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