【发布时间】:2013-02-11 13:14:58
【问题描述】:
我有一个扩展方法:
public static void Foo<T>(this MyClass<T> target)
where T : IEnumerable
{
// Code goes here
}
如果 T 是一个字符串,我想从 InteliSense 隐藏这个扩展方法,而不是其他类型,就像在处理字符串时隐藏 Linq 中 IEnumerable 的扩展方法一样。
我查看了EditorBrowsableAttribute,但它似乎不允许隐藏基于泛型类型的方法。
【问题讨论】:
标签: c# extension-methods intellisense