public static void DeselectItem(IntPtr controlHandle, string itemText)
        {
            try
            {
                AutomationElement control      = CommonUIAPatternHelpers.Prologue(SelectionPattern.Pattern, controlHandle);
                AutomationElement itemToSelect = SelectionItemPatternHelper.FindItemByText(control, itemText);

                StaticEvents.RegisterEvent(SelectionItemPattern.ElementRemovedFromSelectionEvent, control);
                SelectionItemPatternHelper.RemoveFromSelection(itemToSelect);

                LogController.ReceiveLogMessage(new LogMessage("List Item deselected: " + itemText));
            }
            catch (InvalidOperationException)
            {
                /* Call native function */
                ProdListBoxNative.DeSelectItemNative(controlHandle, itemText);
            }
            catch (ElementNotAvailableException err)
            {
                throw new ProdOperationException(err.Message, err);
            }
            catch (ArgumentException err)
            {
                throw new ProdOperationException(err.Message, err);
            }
        }
        private static void UiaRemoveFromSelection(BaseProdControl control, string itemText)
        {
            if (!UiaCanSelectMultiple(control))
            {
                throw new ProdOperationException("Does not support multiple selection");
            }
            AutomationElement itemToSelect = SelectionItemPatternHelper.FindItemByText(control.UIAElement, itemText);

            AutomationEventVerifier.Register(new EventRegistrationMessage(control, SelectionItemPattern.ElementRemovedFromSelectionEvent));

            LogController.ReceiveLogMessage(new LogMessage("Removing " + itemText));
            SelectionItemPatternHelper.RemoveFromSelection(itemToSelect);
        }