public static bool IsCompilerGenerated(TypeNode t) { if (t == null) return false; if (t.Template != null) t = t.Template; if (t.GetAttributeByName(compilerGeneratedAttributeName) != null) return true; if (t.DeclaringType != null) return IsCompilerGenerated(t.DeclaringType); return false; }