Witam wszystkich, temat dosyć banalny, lecz nie potrafię sobie poradzić aby wszystko było ok. Mianowicie problem polega na wywołaniu akcji przypisanej do przycisku za pomocą wartości z case'a przesyłanej do aplikacji przez SIPa. posiadam akcje przycisku:
public void button_click1(object sender, EventArgs e)
{
//Button b = (Button)sender;
if (turn)
this.A1.Text = "X";
else
this.A1.Text = "O";
turn = !turn;
this.A1.Enabled = false;
turn_count++;
checkForWinner();
}
i chcę ją wywołać w ten sposób:
void call_DtmfReceived(object sender, VoIPEventArgs<DtmfInfo> e)
{
DisposeCurrentConnector();
switch (e.Item.Signal.Signal)
{
case 0: Console.WriteLine("0"); break;
case 1: Console.WriteLine("1"); button_click1(null, null); break;
case 2: Console.WriteLine("2"); break;
case 3: Console.WriteLine("3"); break;
case 4: Console.WriteLine("4"); break;
case 5: Console.WriteLine("5"); break;
case 6: Console.WriteLine("6"); break;
case 7: Console.WriteLine("7"); break;
case 8: Console.WriteLine("8"); break;
case 9: Console.WriteLine("9"); break;
case 10: System.Diagnostics.Process.GetCurrentProcess().Kill(); Console.WriteLine("*"); break;
case 11: Console.WriteLine("#"); break;
}
}
efekt takiego rozwiązania jest następujący:
Liczę na każdą pomoc, każdą myśl/rozwiązanie.
Pozdrawiam!