/// <summary>
        /// If the declaration or its parent has the rule provided suppressed it returns true.
        /// </summary>
        /// <param name="declaration">
        /// The declaration to check.
        /// </param>
        /// <param name="ruleId">
        /// The ruleId to see if its suppressed.
        /// </param>
        /// <returns>
        /// True if suppressed.
        /// </returns>
        public static bool IsRuleSuppressed(IDeclaration declaration, string ruleId)
        {
            IAttributesOwnerDeclaration attributesOwnerDeclaration = declaration as IAttributesOwnerDeclaration;

            if (IsRuleSuppressedInternal(attributesOwnerDeclaration, ruleId))
            {
                return true;
            }

            attributesOwnerDeclaration = declaration.GetContainingElement<ICSharpTypeDeclaration>(false);

            return IsRuleSuppressedInternal(attributesOwnerDeclaration, ruleId);
        }