Exemplo n.º 1
0
        public static bool IsAnonymousType(this ITypeDefOrRef type)
        {
            if (type == null)
            {
                return(false);
            }
            string name;

            if (type.HasGeneratedName() && string.IsNullOrEmpty(type.GetNamespaceInternal()) && ((name = type.Name).Contains("AnonType") || name.Contains("AnonymousType")))
            {
                TypeDef td = type.ResolveTypeDef();
                return(td != null && td.IsCompilerGenerated());
            }
            return(false);
        }