示例#1
0
        private static bool ExcludeSpecialAttribute(ICustomAttribute c)
        {
            string typeName = c.FullName();

            switch (typeName)
            {
            case "System.ParamArrayAttribute": return(true);

            case "System.Reflection.AssemblyDelaySignAttribute": return(true);

            case "System.Reflection.AssemblyKeyFileAttribute": return(true);

            case "System.Reflection.DefaultMemberAttribute": return(true);

            case "System.Runtime.CompilerServices.CompilerFeatureRequiredAttribute": return(true);

            case "System.Runtime.CompilerServices.DynamicAttribute": return(true);

            case "System.Runtime.CompilerServices.ExtensionAttribute": return(true);

            case "System.Runtime.CompilerServices.FixedBufferAttribute": return(true);

            case "System.Runtime.CompilerServices.IsByRefLikeAttribute": return(true);

            case "System.Runtime.CompilerServices.IsReadOnlyAttribute": return(true);

            case "System.Runtime.CompilerServices.RequiredMemberAttribute": return(true);

            case "System.Runtime.CompilerServices.TupleElementNamesAttribute": return(true);

            case "System.ObsoleteAttribute":
            {
                var arg = c.Arguments.OfType <IMetadataConstant>().FirstOrDefault();

                if (arg?.Value is string)
                {
                    string argValue = (string)arg.Value;
                    if (argValue is "Types with embedded references are not supported in this version of your compiler."
                        or "Constructors of types with required members are not supported in this version of your compiler.")
                    {
                        return(true);
                    }
                }
                break;
            }
            }
            return(false);
        }
        private static bool ExcludeSpecialAttribute(ICustomAttribute c)
        {
            string typeName = c.FullName();

            switch (typeName)
            {
            case "System.Runtime.CompilerServices.FixedBufferAttribute": return(true);

            case "System.ParamArrayAttribute": return(true);

            case "System.Reflection.DefaultMemberAttribute": return(true);

            case "System.Reflection.AssemblyKeyFileAttribute": return(true);

            case "System.Reflection.AssemblyDelaySignAttribute": return(true);

            case "System.Runtime.CompilerServices.ExtensionAttribute": return(true);

            case "System.Runtime.CompilerServices.DynamicAttribute": return(true);
            }
            return(false);
        }
        private static bool ExcludeSpecialAttribute(ICustomAttribute c)
        {
            string typeName = c.FullName();

            switch (typeName)
            {
                case "System.Runtime.CompilerServices.FixedBufferAttribute": return true;
                case "System.ParamArrayAttribute": return true;
                case "System.Reflection.DefaultMemberAttribute": return true;
                case "System.Reflection.AssemblyKeyFileAttribute": return true;
                case "System.Reflection.AssemblyDelaySignAttribute": return true;
                case "System.Runtime.CompilerServices.ExtensionAttribute": return true;
                case "System.Runtime.CompilerServices.DynamicAttribute": return true;
            }
            return false;
        }