本文整理匯總了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)) { }
}
}