【问题标题】:NDepend: Check if a type implements a generic interfaceNDepend:检查一个类型是否实现了一个泛型接口
【发布时间】:2013-11-05 10:03:09
【问题描述】:

有没有办法检查一个类型是否使用 NDepend 实现了具有某些泛型参数的泛型类型?

实现的接口属性返回泛型类型,但没有特定的泛型参数。所以以 IList 为例,如果某种类型实现 IList,我不想。

【问题讨论】:

    标签: ndepend


    【解决方案1】:

    您可以编写如下查询:

    from t in Types where t.Implement("System.Collections.Generic.IList<T>")
    select t
    

    但您不能编写如下查询:

    from t in Types where t.Implement("System.Collections.Generic.IList<System.Int32>") 
    select t
    

    所以答案是否定的有没有办法检查一个类型是否正在使用 NDepend 实现具有某些泛型参数的泛型类型?

    这种情况将来可能会发生变化,请随时向NDepend User Voice page添加请求。

    【讨论】:

    猜你喜欢
    • 2011-02-01
    • 2010-11-10
    • 1970-01-01
    • 2012-06-09
    • 1970-01-01
    • 1970-01-01
    • 2018-07-26
    • 2013-08-16
    • 2010-10-04
    相关资源
    最近更新 更多