示例#1
0
        //
        // Returns member CLS compliance based on full member hierarchy
        //
        public bool IsCLSCompliant()
        {
            if ((state & StateFlags.CLSCompliant_Undetected) != 0)
            {
                state &= ~StateFlags.CLSCompliant_Undetected;

                bool compliant;
                if (IsNotCLSCompliant(out compliant))
                {
                    return(false);
                }

                if (!compliant)
                {
                    if (DeclaringType != null)
                    {
                        compliant = DeclaringType.IsCLSCompliant();
                    }
                    else
                    {
                        compliant = ((ITypeDefinition)MemberDefinition).DeclaringAssembly.IsCLSCompliant;
                    }
                }

                if (compliant)
                {
                    state |= StateFlags.CLSCompliant;
                }
            }

            return((state & StateFlags.CLSCompliant) != 0);
        }