public virtual void Add(EndpointAddressMessageFilter filter, TFilterData data)
        {
            CandidateSet <TFilterData> set;

            if (filter == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("filter");
            }
            this.filters.Add(filter, data);
            byte[] mask = this.BuildMask(filter.HeaderLookup);
            Candidate <TFilterData> candidate = new Candidate <TFilterData>(filter, data, mask, filter.HeaderLookup);

            this.candidates.Add(filter, candidate);
            Uri key = filter.Address.Uri;

            if (filter.IncludeHostNameInComparison)
            {
                if (!this.toHostLookup.TryGetValue(key, out set))
                {
                    set = new CandidateSet <TFilterData>();
                    this.toHostLookup.Add(key, set);
                }
            }
            else if (!this.toNoHostLookup.TryGetValue(key, out set))
            {
                set = new CandidateSet <TFilterData>();
                this.toNoHostLookup.Add(key, set);
            }
            set.candidates.Add(candidate);
            this.IncrementQNameCount(set, filter.Address);
        }
示例#2
0
 public override bool Remove(EndpointAddressMessageFilter filter)
 {
     if (filter == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("filter");
     }
     throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException("EndpointAddressMessageFilter cannot be removed from PrefixEndpointAddressMessageFilterTable"));
 }
示例#3
0
 public override void Add(EndpointAddressMessageFilter filter, TFilterData data)
 {
     if (filter == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("filter");
     }
     throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException("EndpointAddressMessageFilter cannot be added to PrefixEndpointAddressMessageFilterTable"));
 }
        public virtual bool Remove(MessageFilter filter)
        {
            if (filter == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("filter");
            }
            EndpointAddressMessageFilter filter2 = filter as EndpointAddressMessageFilter;

            return((filter2 != null) && this.Remove(filter2));
        }
示例#5
0
        public virtual bool Remove(EndpointAddressMessageFilter filter)
        {
            if (filter == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("filter");
            }

            if (!this.filters.Remove(filter))
            {
                return(false);
            }

            Candidate can = this.candidates[filter];

#pragma warning suppress 56506 // [....], EndpointAddressMessageFilter.Address can never be null
            Uri soapToAddress = filter.Address.Uri;

            CandidateSet cset = null;
            if (filter.IncludeHostNameInComparison)
            {
                cset = this.toHostLookup[soapToAddress];
            }
            else
            {
                cset = this.toNoHostLookup[soapToAddress];
            }

            this.candidates.Remove(filter);

            if (cset.candidates.Count == 1)
            {
                if (filter.IncludeHostNameInComparison)
                {
                    this.toHostLookup.Remove(soapToAddress);
                }
                else
                {
                    this.toNoHostLookup.Remove(soapToAddress);
                }
            }
            else
            {
                DecrementQNameCount(cset, filter.Address);

                // Remove Candidate
                cset.candidates.Remove(can);
            }

            RebuildMasks();
            return(true);
        }
示例#6
0
        public virtual bool Remove(MessageFilter filter)
        {
            if (filter == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("filter");
            }

            EndpointAddressMessageFilter saFilter = filter as EndpointAddressMessageFilter;

            if (saFilter != null)
            {
                return(Remove(saFilter));
            }

            return(false);
        }
        public virtual bool Remove(EndpointAddressMessageFilter filter)
        {
            if (filter == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("filter");
            }
            if (!this.filters.Remove(filter))
            {
                return(false);
            }
            Candidate <TFilterData> item = this.candidates[filter];
            Uri key = filter.Address.Uri;
            CandidateSet <TFilterData> cset = null;

            if (filter.IncludeHostNameInComparison)
            {
                cset = this.toHostLookup[key];
            }
            else
            {
                cset = this.toNoHostLookup[key];
            }
            this.candidates.Remove(filter);
            if (cset.candidates.Count == 1)
            {
                if (filter.IncludeHostNameInComparison)
                {
                    this.toHostLookup.Remove(key);
                }
                else
                {
                    this.toNoHostLookup.Remove(key);
                }
            }
            else
            {
                this.DecrementQNameCount(cset, filter.Address);
                cset.candidates.Remove(item);
            }
            this.RebuildMasks();
            return(true);
        }
示例#8
0
        public virtual void Add(EndpointAddressMessageFilter filter, TFilterData data)
        {
            if (filter == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("filter");
            }

            this.filters.Add(filter, data);

            // Create the candidate
            byte[]    mask = BuildMask(filter.HeaderLookup);
            Candidate can  = new Candidate(filter, data, mask, filter.HeaderLookup);

            this.candidates.Add(filter, can);

            CandidateSet cset;

#pragma warning suppress 56506 // [....], EndpointAddressMessageFilter.Address can never be null
            Uri soapToAddress = filter.Address.Uri;
            if (filter.IncludeHostNameInComparison)
            {
                if (!this.toHostLookup.TryGetValue(soapToAddress, out cset))
                {
                    cset = new CandidateSet();
                    this.toHostLookup.Add(soapToAddress, cset);
                }
            }
            else
            {
                if (!this.toNoHostLookup.TryGetValue(soapToAddress, out cset))
                {
                    cset = new CandidateSet();
                    this.toNoHostLookup.Add(soapToAddress, cset);
                }
            }
            cset.candidates.Add(can);

            IncrementQNameCount(cset, filter.Address);
        }
示例#9
0
 public bool Remove(EndpointAddressMessageFilter filter)
 {
     throw new NotImplementedException();
 }
示例#10
0
 public void Add(EndpointAddressMessageFilter filter, TFilterData data)
 {
     throw new NotImplementedException();
 }