小编Bru*_*son的帖子

为什么i ++"无法访问代码"?

编辑

我把它留在这里,即使它让我看起来很愚蠢,因为它是一个微妙的虫子,如果你在深夜工作而不注意它会咬你.感谢Visual Studio提供这样一个智能解析器.

基本上我错过了我有嵌套循环,所以continue这里的语句基本上没用,因为它继续foreach循环,而不是for循环.

原始问题

我正在搜索工作簿,寻找符合所有字符串搜索条件的工作表.在Visual Studio编辑器中,i++下划线为"无法访问的代码".

/// <summary>
/// Finds the first sheet that has cells that match all the criteria.
/// </summary>
/// <param name="wb"></param>
/// <param name="searches"></param>
/// <returns></returns>
public static ISheet FindSheet( this IWorkbook wb, params string[] searches )
{
    if( null == wb || null == searches )
        return null;

    for( int i = 0; i < wb.NumberOfSheets; i++ )
    {
        var sheet = wb.GetSheetAt( i ); …
Run Code Online (Sandbox Code Playgroud)

c# loops visual-studio

4
推荐指数
1
解决办法
811
查看次数

StringTemplate与StringTemplateGroup

我成功使用StringTemplate 4在Visual Studio中进行代码生成.我已经安装了StringTemplate和ANTLR的扩展,它们非常棒.

在测试中,我可以弄清楚如何使用*.st4(StringTemplate)文件,但是如何使用*.stg(StringTemplateGroup)文件逃避了我.它是可以嵌入到另一个StringTemplate中的定义集合吗?如果是这样,那么从*.stg而不是*.st4生成的代码是什么样的?

c# antlr stringtemplate visual-studio

1
推荐指数
1
解决办法
3486
查看次数

标签 统计

c# ×2

visual-studio ×2

antlr ×1

loops ×1

stringtemplate ×1