當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。