public void UnregisterBindingFilter(MsmqBindingFilter filter) { lock (this.thisLock) { foreach (MsmqBindingMonitor monitor in this.bindingMonitors.Values) { monitor.RemoveFilter(filter); } } }
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); } } }