private void dispatcherTimer_Tick(object sender, EventArgs e) { time++; Timer.Text = "Czas: " + timeToString(); if (cvm.CallModel.CallState == "create" && time == 7) { string tmp = cvm.CallModel.FriendLogin + ": %SYSTEM%PLEASEWAIT"; if (cvm.CallModel.Chat[0] == tmp) { SendButton.IsEnabled = true; NotWaitToCallButton.IsEnabled = true; cvm.sendMessage("%SYSTEM%YESIWAIT"); cvm.CallModel.Chat.Clear(); } else { MessageBox.Show("Abonent czasowo niedostępny"); pleaseClose = true; Close(); } } }