本文整理汇总了C#中Microsoft.VisualStudioTools.VisualStudioApp.WaitForTaskListItems方法的典型用法代码示例。如果您正苦于以下问题:C# VisualStudioApp.WaitForTaskListItems方法的具体用法?C# VisualStudioApp.WaitForTaskListItems怎么用?C# VisualStudioApp.WaitForTaskListItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.VisualStudioTools.VisualStudioApp
的用法示例。
在下文中一共展示了VisualStudioApp.WaitForTaskListItems方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ErrorListAndTaskListAreClearedWhenProjectWithMultipleFilesIsUnloaded
public void ErrorListAndTaskListAreClearedWhenProjectWithMultipleFilesIsUnloaded() {
using (var app = new VisualStudioApp()) {
var project = app.OpenProject(@"TestData\ErrorProjectMultipleFiles.sln");
app.WaitForTaskListItems(typeof(SVsErrorList), 14);
app.WaitForTaskListItems(typeof(SVsTaskList), 4);
var solutionService = app.GetService<IVsSolution>(typeof(SVsSolution));
Assert.IsNotNull(solutionService);
IVsHierarchy selectedHierarchy;
ErrorHandler.ThrowOnFailure(solutionService.GetProjectOfUniqueName(project.UniqueName, out selectedHierarchy));
Assert.IsNotNull(selectedHierarchy);
Console.WriteLine("Unloading project");
ErrorHandler.ThrowOnFailure(solutionService.CloseSolutionElement((uint)__VSSLNCLOSEOPTIONS.SLNCLOSEOPT_UnloadProject, selectedHierarchy, 0));
app.WaitForTaskListItems(typeof(SVsErrorList), 0);
app.WaitForTaskListItems(typeof(SVsTaskList), 0);
}
}
示例2: TaskListTest
internal void TaskListTest(VisualStudioApp app, Type taskListService, IList<TaskItemInfo> expectedItems, int[] navigateTo = null) {
var items = app.WaitForTaskListItems(taskListService, expectedItems.Count);
var actualItems = items.Select(item => new TaskItemInfo(item)).ToList();
Assert.AreEqual(expectedItems.Count, actualItems.Count);
AssertUtil.ContainsExactly(actualItems, expectedItems.ToSet());
if (navigateTo != null) {
foreach (var i in navigateTo) {
Console.WriteLine("Trying to navigate to " + expectedItems[i]);
var j = actualItems.IndexOf(expectedItems[i]);
Assert.IsTrue(j >= 0);
app.ServiceProvider.GetUIThread().Invoke((Action)delegate { items[j].NavigateTo(); });
var doc = app.Dte.ActiveDocument;
Assert.IsNotNull(doc);
Assert.AreEqual(expectedItems[i].Document, doc.FullName);
var textDoc = (EnvDTE.TextDocument)doc.Object("TextDocument");
Assert.AreEqual(expectedItems[i].Line + 1, textDoc.Selection.ActivePoint.Line);
Assert.AreEqual(expectedItems[i].Column + 1, textDoc.Selection.ActivePoint.DisplayColumn);
}
}
}
示例3: ErrorListAndTaskListAreClearedWhenProjectIsDeleted
public void ErrorListAndTaskListAreClearedWhenProjectIsDeleted() {
using (var app = new VisualStudioApp()) {
var project = app.OpenProject(@"TestData\ErrorProjectDelete.sln");
app.WaitForTaskListItems(typeof(SVsErrorList), 7);
app.WaitForTaskListItems(typeof(SVsTaskList), 2);
Console.WriteLine("Deleting project");
app.Dte.Solution.Remove(project);
app.WaitForTaskListItems(typeof(SVsErrorList), 0);
app.WaitForTaskListItems(typeof(SVsTaskList), 0);
}
}