Click here to Skip to main content
15,896,153 members
Articles / Programming Languages / C#

A Universal Event Handler Factory

Rate me:
Please Sign up or sign in to vote.
4.83/5 (20 votes)
2 Aug 2005CPOL4 min read 128.7K   1.7K   86  
A factory, which dynamically creates helper classes to hook on events of any signature.
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>CommonEventHandler</name>
    </assembly>
    <members>
        <member name="T:CommonEventHandler.CommonEventHandlerDlgt">
            <summary>
            This delegate describes the signature of the event, which is emited by the generated helper classes.
            </summary>
        </member>
        <member name="T:CommonEventHandler.EventHandlerFactory">
            <summary>
            Summary description for EventHandlerFactory.
            </summary>
        </member>
        <member name="M:CommonEventHandler.EventHandlerFactory.#ctor(System.String)">
            <summary>
            Creates the EventHandlerFactory.
            </summary>
            <param name="Name">Name of the Factory. Is used as naming component of the event handlers to create.</param>
        </member>
        <member name="M:CommonEventHandler.EventHandlerFactory.GetEventHandler(System.Reflection.EventInfo)">
            <summary>
            Creates an event handler for the specified event
            </summary>
            <param name="Info">The event info class of the event</param>
            <returns>The created event handler help class.</returns>
        </member>
        <member name="T:CommonEventHandler.EventHandlerTypeEmitter">
            <summary>
            Summary description for EventHandlerTypeEmitter.
            </summary>
        </member>
        <member name="M:CommonEventHandler.EventHandlerTypeEmitter.#ctor(System.String)">
            <summary>
            Constructor
            </summary>
            <param name="Name">The name, which the is given to assembly, module and class.</param>
        </member>
        <member name="M:CommonEventHandler.EventHandlerTypeEmitter.GetEventHandlerType(System.Reflection.EventInfo)">
            <summary>
            Emits dynamically a event handler with a given signature, which fills all arguments of the event in an object array 
            and calls a common event.
            </summary>
            <returns></returns>
        </member>
    </members>
</doc>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Germany Germany
First computer in 1977.
Since then, addicted to computers and programming.
Founder and CEO of the prosa GmbH, a german consulting company focused on .NET solutions.
Married, 4 adult children, living in Mering near Munich.

Comments and Discussions