本文整理汇总了C#中VisualStudioApp.WaitForInputIdle方法的典型用法代码示例。如果您正苦于以下问题:C# VisualStudioApp.WaitForInputIdle方法的具体用法?C# VisualStudioApp.WaitForInputIdle怎么用?C# VisualStudioApp.WaitForInputIdle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisualStudioApp
的用法示例。
在下文中一共展示了VisualStudioApp.WaitForInputIdle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestShowCallStackOnCodeMap
public void TestShowCallStackOnCodeMap() {
using (var app = new VisualStudioApp()) {
var project = OpenDebuggerProjectAndBreak(app, "SteppingTest3.py", 2);
app.Dte.ExecuteCommand("Debug.ShowCallStackonCodeMap");
// Got the CodeMap Graph displaying. Now we need to save, or at least make it have a version in temp.
app.WaitForInputIdle();
app.Dte.Documents.SaveAll();
// VS is saving a temp version of the codemap in the Local AppData Temp directory. We will compare to that for verification.
var tempFiles = Directory.GetFiles(Environment.ExpandEnvironmentVariables("%temp%"), "*.dgml", SearchOption.TopDirectoryOnly);
var dgmlFile = (from x in tempFiles orderby File.GetCreationTime(x) descending select x).First();
// These are the lines of interest in the DGML File. If these match, the correct content should be displayed in the code map.
List<string> LinesToMatch = new List<string>() {
@"<Node Id=""\(Name=f @1 IsUnresolved=True\)"" Category=""CodeSchema_CallStackUnresolvedMethod"" Bounds=""[0-9,\.]+"" Label=""f"">",
@"<Node Id=""@2"" Category=""CodeSchema_CallStackUnresolvedMethod"" Bounds=""[0-9,\.]+"" Label=""SteppingTest3 module"">",
@"<Node Id=""ExternalCodeRootNode"" Category=""ExternalCallStackEntry"" Bounds=""[0-9,\.]+"" Label=""External Code"">",
@"<Link Source=""@2"" Target=""\(Name=f @1 IsUnresolved=True\)"" Category=""CallStackDirectCall"">",
@"<Alias n=""1"" Uri=""Assembly=SteppingTest3"" />",
@"<Alias n=""2"" Id=""\(Name="SteppingTest3 module" @1 IsUnresolved=True\)"" />"
};
var fileText = File.ReadAllText(dgmlFile);
foreach (var line in LinesToMatch) {
Assert.IsTrue(System.Text.RegularExpressions.Regex.IsMatch(fileText, line), "Expected:\r\n{0}\r\nsActual:\r\n{1}", line, fileText);
}
}
}