示例#1
0
 public void UnregisterBindingFilter(MsmqBindingFilter filter)
 {
     lock (this.thisLock)
     {
         foreach (MsmqBindingMonitor monitor in this.bindingMonitors.Values)
         {
             monitor.RemoveFilter(filter);
         }
     }
 }
示例#2
0
            public void RegisterBindingFilterIfNecessary(string host, MsmqBindingFilter filter)
            {
                lock (this.thisLock)
                {
                    MsmqBindingMonitor bindingMonitor;
                    if (!this.bindingMonitors.TryGetValue(host, out bindingMonitor))
                    {
                        bindingMonitor = new MsmqBindingMonitor(host);
                        bindingMonitor.Open();
                        this.bindingMonitors.Add(host, bindingMonitor);
                    }

                    // register the new filter if it doesn't already exist:
                    if (!bindingMonitor.ContainsFilter(filter))
                    {
                        bindingMonitor.AddFilter(filter);
                    }
                }
            }