本文整理汇总了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;
}
示例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"));
}
}
示例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);
}
}
示例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)) { }
}
}
示例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)) { }
}
}