I have this issue with a method in C#. I made a method that calls a function from a dll its called Phone.GetLampMode();
Now Phone.GetLampMode
doesnt return anything. The data gets returned in a event the 'onGetLampModeResponse
' event. Is there a way i can wait in my method until i get the data from the onGetLampModeResponse event?
public bool checkLamp(int iLamp)
{
Phone.ButtonIDConstants btn = new Phone.ButtonIDConstants();
btn = Phone.ButtonIDConstants.BUTTON_1;
btn += iLamp;
Phone.GetLampMode(btn, null);
return true;
}
private void Phone_OnGetLampModeResponse(object sender, Phone.GetLampModeResponseArgs e)
{
var test = e.getLampModeList[0].getLampMode.ToString();
}
sender
in the event handler or inside thee
? EDIT: Yeah it is, it's called userState. You can retrieve this userState inside thee
variable in the callback function. – Bootebool
that is set totrue
byOnGetLampModeResponse
and checked in a loop bycheckLamp
. – Wuhu