AtspiUiaSource.AutomationSource.RemoveAutomationEventHandler C# (CSharp) Method

RemoveAutomationEventHandler() public method

public RemoveAutomationEventHandler ( AutomationEvent eventId, IElement element, AutomationEventHandler eventHandler ) : void
eventId System.Windows.Automation.AutomationEvent
element IElement
eventHandler AutomationEventHandler
return void
		public void RemoveAutomationEventHandler (AutomationEvent eventId,
		                                          IElement element,
		                                          AutomationEventHandler eventHandler)
		{
			List<AutomationEventHandlerData> handlersToDelete = new List<AutomationEventHandlerData> ();
			foreach (var handlerData in automationEventHandlers) {
				if (handlerData.Element == element && handlerData.EventHandler == eventHandler && handlerData.EventId == eventId) {
					handlersToDelete.Add (handlerData);
				}
			}
			foreach (var h in handlersToDelete)
				automationEventHandlers.Remove (h);
		}