Пример #1
0
        public CspDirective Union(CspDirective other)
        {
            // Remove duplicates.
            var expressions = Expressions
                              .Union(other.Expressions)
                              .ToArray();

            var hasNone = expressions.Any(e => e == "'none'");

            if (hasNone)
            {
                return(new CspDirective(
                           Name,
                           expressions
                           .Where(e => e != "'none'")
                           .ToArray()
                           ));
            }

            return(new CspDirective(
                       Name,
                       expressions
                       ));
        }
Пример #2
0
 protected bool Equals(CspDirective other)
 {
     return(Name == other.Name && Expressions.SequenceEqual(other.Expressions));
 }