Prevent next event handler being called

后端 未结 6 1210
孤街浪徒
孤街浪徒 2021-01-21 01:35

I have two event handlers wired up to a button click in a Windows form like so:

this.BtnCreate.Click += new System.EventHandler(new RdlcCreator().FirstHandler);
         


        
6条回答
  •  太阳男子
    2021-01-21 02:20

    I suggest you to create a some kind of class wrapper. So, you could store there some kind of event flag group (16bit integer, for example) and a few methods to set or unset individual bits (where each means to invoke or not particular EventHandler). You can easily store any count of the Eventhandlers or even Actions, in the class, and invoke in any order you want.

提交回复
热议问题