GSF.Diagnostics.PublisherFilter.ContainsPublisher C# (CSharp) Method

ContainsPublisher() public method

Gets if this subscription contains the publisher.
public ContainsPublisher ( LogPublisherInternal publisher ) : bool
publisher LogPublisherInternal the publisher to check
return bool
        public bool ContainsPublisher(LogPublisherInternal publisher)
        {
            if (publisher == null)
                throw new ArgumentNullException(nameof(publisher));

            switch (m_filterType)
            {
                case FilterType.Universal:
                    return true;
                case FilterType.Assembly:
                    if (m_isExpression)
                        return m_regexMatch.IsMatch(publisher.TypeData.AssemblyName);
                    return publisher.TypeData.AssemblyName.Equals(m_text, StringComparison.OrdinalIgnoreCase);
                case FilterType.Type:
                    if (m_isExpression)
                        return m_regexMatch.IsMatch(publisher.TypeData.TypeName);
                    return publisher.TypeData.TypeName.Equals(m_text, StringComparison.OrdinalIgnoreCase);
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }