Esempio n. 1
0
        public bool Remove(PrefixEndpointAddressMessageFilter filter)
        {
            if (filter == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("filter");
            }
            if (!base.filters.Remove(filter))
            {
                return(false);
            }
            EndpointAddressMessageFilterTable <TFilterData> .Candidate item = base.candidates[filter];
            Uri to = filter.Address.Uri;

            EndpointAddressMessageFilterTable <TFilterData> .CandidateSet cset = null;
            if (this.TryMatchCandidateSet(to, filter.IncludeHostNameInComparison, out cset))
            {
                if (cset.candidates.Count == 1)
                {
                    this.GetAddressTable(filter.IncludeHostNameInComparison).UnregisterUri(to, this.GetComparisonMode(filter.IncludeHostNameInComparison));
                }
                else
                {
                    base.DecrementQNameCount(cset, filter.Address);
                    cset.candidates.Remove(item);
                }
            }
            base.candidates.Remove(filter);
            base.RebuildMasks();
            return(true);
        }
Esempio n. 2
0
        public void Add(PrefixEndpointAddressMessageFilter filter, TFilterData data)
        {
            EndpointAddressMessageFilterTable <TFilterData> .CandidateSet set;
            if (filter == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("filter");
            }
            base.filters.Add(filter, data);
            byte[] mask = base.BuildMask(filter.HeaderLookup);
            EndpointAddressMessageFilterTable <TFilterData> .Candidate candidate = new EndpointAddressMessageFilterTable <TFilterData> .Candidate(filter, data, mask, filter.HeaderLookup);

            base.candidates.Add(filter, candidate);
            Uri to = filter.Address.Uri;

            if (!this.TryMatchCandidateSet(to, filter.IncludeHostNameInComparison, out set))
            {
                set = new EndpointAddressMessageFilterTable <TFilterData> .CandidateSet();

                this.GetAddressTable(filter.IncludeHostNameInComparison).RegisterUri(to, this.GetComparisonMode(filter.IncludeHostNameInComparison), set);
            }
            set.candidates.Add(candidate);
            base.IncrementQNameCount(set, filter.Address);
        }
Esempio n. 3
0
 internal override bool TryMatchCandidateSet(Uri to, bool includeHostNameInComparison, out EndpointAddressMessageFilterTable <TFilterData> .CandidateSet cset)
 {
     return(this.GetAddressTable(includeHostNameInComparison).TryLookupUri(to, this.GetComparisonMode(includeHostNameInComparison), out cset));
 }