def create_event_from_class(constructor, klass, parameter_names, name_name, event_name):
    """
    Creates an event passing trough a constructor.
    
    Parameters
    ----------
    klass : `type`
        The type to work with.
    parameter_names : `tuple` of `str`
        The parameters names to pass to the constructor.
    name_name : `str` or `None`
        The event's name's name.
    event_name : `str`
        The event's name. If event is nto found, then defaults to `name_name`'s found value if any.
    
    Returns
    -------
    instance : `Any`
        The created instance.
    
    Raises
    ------
    BasesException
        Any occurred exception.
    """
    if not isinstance(klass, type):
        raise TypeError(f'Expected `type` instance, got {klass.__class__.__name__}.')
    
    parameters_by_name = {}
    for parameter_name in parameter_names:
        try:
            parameter = getattr(klass, parameter_name)
        except AttributeError:
            found = False
            parameter = None
        else:
            found = True
        
        parameters_by_name[parameter_name] = (parameter, found)
    
    name = klass.__name__
    if (name_name is not None) and (not parameters_by_name[name_name][1]):
        parameters_by_name[name_name] = (name, True)
    
    if not parameters_by_name[event_name][1]:
        try:
            parameter = getattr(klass, name)
        except AttributeError:
            pass
        else:
            parameters_by_name[event_name] = (parameter, True)
    
    return constructor(*(parameters_by_name[parameter_name][0] for parameter_name in parameter_names))