Menu

#21 Make GThreadFinish and GApplicationFinish pass the GApp

open
nobody
None
5
2007-02-08
2007-02-08
No

Currently the ThreadFinish and ApplicationFinish events do not pass the actual GApplication.

This makes it difficult to do things like loop through each thread and read their output when the application is finished, without explicitly making the scope of the GApplication more global.

It would be nice if the model followed the
EventHandler( object sender )
design of Microsoft's... i.e., something like:

App_ThreadFinished( GApplication application, GThread thread );
App_ApplicationFinished( GApplication application );

NOTE: this _will_ be a breaking change in the framework... proper change management procedures ought to be determined and formalized

Discussion

  • Matt Valerio

    Matt Valerio - 2007-02-08

    Logged In: YES
    user_id=1084407
    Originator: NO

    I agree. We'll have to do something like:

    public delegate void GApplicationFinish();
    gets changed to:
    public delegate void GApplicationFinish(object sender);

    etc for the other two.

     
  • Matt Valerio

    Matt Valerio - 2007-02-13

    Logged In: YES
    user_id=1084407
    Originator: NO

    While we're making breaking changes, I propose the following prototypes (they seem to fit the standard event convention better):

    public delegate void ApplicationFinishedEventHandler(object sender);
    public delegate void ThreadFinishedEventHandler(object sender, GThread thread);
    public delegate void ThreadFailedEventHandler(object sender, GThread thread, Exception exception);

    and then in GApplication, define:

    public event ApplicationFinishedEventHandler ApplicationFinished { get{...} set{...}}
    public event ThreadFinishedEventHandler ThreadFinished { get{...} set{...}}
    public event ThreadFailedEventHandler ThreadFailed { get{...} set{...}}

     

Log in to post a comment.