- /// <summary>
- /// Goes through class hierarchy and get value of first CLSCompliantAttribute that found.
- /// If no is attribute exists then return assembly CLSCompliantAttribute.
- /// </summary>
- public bool GetClsCompliantAttributeValue ()
- {
- if ((caching_flags & Flags.HasCompliantAttribute_Undetected) == 0)
- return (caching_flags & Flags.ClsCompliantAttributeTrue) != 0;
-
- caching_flags &= ~Flags.HasCompliantAttribute_Undetected;
-
- if (OptAttributes != null) {
- Attribute cls_attribute = OptAttributes.Search (TypeManager.cls_compliant_attribute_type);
- if (cls_attribute != null) {
- caching_flags |= Flags.HasClsCompliantAttribute;
- if (cls_attribute.GetClsCompliantAttributeValue ()) {
- caching_flags |= Flags.ClsCompliantAttributeTrue;
- return true;
- }
- return false;
- }
- }
-
- if (Parent == null) {
- if (CodeGen.Assembly.IsClsCompliant) {
- caching_flags |= Flags.ClsCompliantAttributeTrue;
- return true;
- }
- return false;
- }
-
- if (Parent.GetClsCompliantAttributeValue ()) {
- caching_flags |= Flags.ClsCompliantAttributeTrue;
- return true;
- }
- return false;
- }
-