How to raise an event when another event is raised?

Posted by WulfgarPro on Stack Overflow See other posts from Stack Overflow or by WulfgarPro
Published on 2011-01-18T03:50:07Z Indexed on 2011/01/18 3:53 UTC
Read the original article Hit count: 151

Filed under:
|

Hi,

I have an application that handles the OnQuit event of another running application. I would like to raise an additional (custom) event when the OnQuit event is handled. How could I implement such an event?

My OnQuit handler is like so:

    private void StkQuit()
    {
        _stkApplicationUi.OnQuit -= StkQuit;
        Marshal.FinalReleaseComObject(_stkApplicationUi);
        Application.Exit();
    }

The reason I require the additional event is so that I can tell my View layer that the application has exited. If this is not the correct way, what would be better?

WulfgarPro

© Stack Overflow or respective owner

Related posts about c#

Related posts about events