Beispiel #1
0
        /// <summary>Removes an <see cref="AttributeKind"/> from an <see cref="Argument"/></summary>
        /// <param name="self">The <see cref="Argument"/> to add attributes to</param>
        /// <param name="kind"><see cref="AttributeKind"/> to remove</param>
        /// <returns>
        /// <paramref name="self"/> for Fluent access
        /// </returns>
        public static Argument RemoveAttribute([ValidatedNotNull] this Argument self, AttributeKind kind)
        {
            kind.ValidateDefined(nameof(kind));
            if (kind == AttributeKind.None)
            {
                return(self);
            }

            return(RemoveAttribute(self, kind.GetAttributeName( )));
        }
Beispiel #2
0
        /// <summary>Removes an <see cref="AttributeKind"/> from an <see cref="Argument"/></summary>
        /// <param name="kind"><see cref="AttributeKind"/> to remove</param>
        /// <returns>This Argument for fluent usage</returns>
        public Argument RemoveAttribute(AttributeKind kind)
        {
            kind.ValidateDefined(nameof(kind));
            if (kind == AttributeKind.None)
            {
                return(this);
            }

            return(RemoveAttribute(kind.GetAttributeName( )));
        }
 /// <summary>Removes an attribute from a collection.</summary>
 /// <param name="set">Attribute collection (set) to remove the attribute from.</param>
 /// <param name="kind"><see cref="AttributeKind"/> to remove.</param>
 /// <returns><see langword="true"/> if <paramref name="kind"/> was in <paramref name="set"/> before being removed.</returns>
 public static bool Remove(this ICollection <AttributeValue> set, AttributeKind kind)
 {
     return(Remove(set, kind.GetAttributeName()));
 }