当前位置: 首页>>代码示例>>C#>>正文


C# VisualStudioApp.WaitForInputIdle方法代码示例

本文整理汇总了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=&quot;SteppingTest3 module&quot; @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);
                }
            }
        }
开发者ID:omnimark,项目名称:PTVS,代码行数:31,代码来源:DebugProject.cs


注:本文中的VisualStudioApp.WaitForInputIdle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。