Hi all,
I have a quick question I am working on an automation script and have run into an issue. I have created a dialog button and I am trying to run a method when the butto is pressed. so far I have this:
public event EventHandler<EventArgs> Pressed;
public void Button_Pressed(object sender, EventArgs e)
{
controller.Engine.Log("Entering Event");
AddPort(sender, e, protocol.Protocol);
controller.Engine.ExitSuccess("0");
}
I have tried both of these but the method does not trigger when button is pressed
dialog.Button.Pressed += new EventHandler<EventArgs>(Button_Pressed);
dialog.Button.Pressed += (sender,e) => Pressed(sender,e);
I have a drop down list and everything works for the OnChange event but for the button I can't get it to work.
Thank you so much in advance.
Hi Thomas and Floris,
The example that you shared was pretty much what I had, thanks to your questions and help I have been able to finaly solve it.
the issue was after running the dialog again after making a few changes to the original dialog and running the second altered dialog it does not have the event registered so what I did was add the event again before the second controller.Run(dialog).
Thank you for the help