示例#1
0
        public static bool IsGenericClosure(this MethodReference member)
        {
            if (member.HasGenericParameters && member.HasGeneratedName())
            {
                var definition = member as MethodDefinition;

                if (definition != null)
                {
                    var index  = member.Name.IndexOf(">");
                    var result = definition.CustomAttributes.Any(x => x.AttributeType.Name == "CompilerGeneratedAttribute") &&
                                 (index > -1) &&
                                 (member.Name.Substring(index + 1, 1) == "b");
                    return(result);
                }
            }
            return(false);
        }