# Path: AXUI/logger/logger.py
# LOGGER = logging.getLogger(logger_config.logger_name)


from comtypes.client import GetModule, CreateObject
from AXUI.logger import LOGGER
import ctypes
            LOGGER.debug("This property:%s is not supported by this UIAElment" , property_identifier)
            return ""
        return property_value
        
    elif property_identifier in UIA_control_pattern_availability_property_identifiers_mapping:
        property_value = UIAElement.GetCurrentPropertyValue(UIA_control_pattern_availability_property_identifiers_mapping[property_identifier])
        if property_value is None:
            LOGGER.debug("This property:%s is not supported by this UIAElment" , property_identifier)
            return ""
        return property_value
    else:
        LOGGER.debug("This property identifier is not support: %s, cannot get it from UIA typelib" % property_identifier)
        return None
    
def get_pattern_by_id(UIAElement, pattern_identifier):
    '''get UIA element pattern by identifier, return None if fail
    
    Arguments:
        UIAElement: UIA Element instance
        pattern_identifier: pattern identifier
    Returns:
        pattern instance if success
        None if pattern_identifier not valid or not supported by UIA Element
    '''
    if pattern_identifier in UIA_control_pattern_identifers_mapping:
        UIA_pattern_identifier = UIA_control_pattern_identifers_mapping[pattern_identifier][0]
        UIA_pattern_interface = UIA_control_pattern_identifers_mapping[pattern_identifier][1]
        
        pattern = UIAElement.GetCurrentPatternAs(UIA_pattern_identifier, UIA_pattern_interface._iid_)
        if pattern is None:

# Path: AXUI/logger/logger.py
# LOGGER = logging.getLogger(logger_config.logger_name)


# Path: AXUI/driver/windows_driver/UIA.py
from comtypes.client import GetModule, CreateObject
from AXUI.logger import LOGGER
import ctypes

            LOGGER.debug("This property:%s is not supported by this UIAElment" , property_identifier)
            return ""
        return property_value
        
    elif property_identifier in UIA_control_pattern_availability_property_identifiers_mapping:
        property_value = UIAElement.GetCurrentPropertyValue(UIA_control_pattern_availability_property_identifiers_mapping[property_identifier])
        if property_value is None:
            LOGGER.debug("This property:%s is not supported by this UIAElment" , property_identifier)
            return ""
        return property_value
    else:
        LOGGER.debug("This property identifier is not support: %s, cannot get it from UIA typelib" % property_identifier)
        return None
    
def get_pattern_by_id(UIAElement, pattern_identifier):
    '''get UIA element pattern by identifier, return None if fail
    
    Arguments:
        UIAElement: UIA Element instance
        pattern_identifier: pattern identifier
    Returns:
        pattern instance if success
        None if pattern_identifier not valid or not supported by UIA Element
    '''
    if pattern_identifier in UIA_control_pattern_identifers_mapping:
        UIA_pattern_identifier = UIA_control_pattern_identifers_mapping[pattern_identifier][0]
        UIA_pattern_interface = UIA_control_pattern_identifers_mapping[pattern_identifier][1]
        
        pattern = UIAElement.GetCurrentPatternAs(UIA_pattern_identifier, UIA_pattern_interface._iid_)
        if pattern is None:

            LOGGER.debug("This pattern:%s is not supported by this UIAElment" , pattern_identifier)