I am looking at HasFlag implementation, there is InternalHasFlag(...)
call. How can I see sources of it?
Question tittle might be a bit misleading (feel free to correct).
My original problem comes from attempt to make enum
extension method, here is one
public static Enum Mask(this Enum @this, Enum mask)
{
if (mask == null)
throw new ArgumentNullException("mask");
if (!@this.GetType().IsEquivalentTo(mask.GetType()))
throw new ArgumentException("Type mismatch", "mask");
return (Enum)(object)((int)(object)@this & (int)(object)mask);
}
I am very unsure in last line and wanted to see how ms-guy does it.