internal static bool LikeAnonymousClass(Type type)
{
Debug.Assert(type != null);
return type.IsNotPublic && type.IsClass && type.IsSealed
&& type.GetConstructor(Type.EmptyTypes) == null
#if NET_1_0 || NET_1_1
&& AnyObjectByTypeName(type.GetCustomAttributes(false),
"System.Runtime.CompilerServices.CompilerGeneratedAttribute")
#else
&& type.IsGenericType
&& type.IsDefined(typeof(System.Runtime.CompilerServices.CompilerGeneratedAttribute), false)
#endif
;
}