private void menuItemRestartPhone_Click(object sender, RoutedEventArgs e) { if (MessageBox.Show("Soll das Telefon wirklich neu gestartet werden?", "Telefon Neustart", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) { WebHandler.RestartPhone(); } }
private void BtnEndCall_Click(object sender, RoutedEventArgs e) { WebHandler.SendKeyAsync("ONHOOK"); WebHandler.SendKeyAsync("CANCEL"); if (Settings.Default.AutoSwitchOutput == 1) { WebHandler.SendKeyAsync("HEADSET"); } }
private void BtnPickUp_Click(object sender, RoutedEventArgs e) { switch (Settings.Default.AutoSwitchOutput) { case 1: WebHandler.SendKeyAsync("HEADSET"); break; case 2: WebHandler.SendKeyAsync("SPEAKER"); break; default: WebHandler.SendKeyAsync("OFFHOOK"); break; } }
private void BtnCall_Click(object sender, RoutedEventArgs e) { string callNumber = tbNumber.Text; // Only allow 0-9, +, -, /, *, (, ) if (new Regex(@"[0-9+\-\/\*\(\)]").Matches(callNumber).Count == 0) { MessageBox.Show("Bitte trage eine gültige Telefonnummer in das Textfeld ein!", "Fehler", MessageBoxButton.OK, MessageBoxImage.Warning); } else { // Remove spaces, slashes and dashes from number callNumber = Regex.Replace(callNumber, @"\s+|\/|\-|\(|\)", ""); if (callNumber.StartsWith("+")) { callNumber = Regex.Replace(callNumber, @"\+", "00"); } if (callNumber.Substring(4, 1).Equals("0")) { callNumber = callNumber.Remove(4, 1); } switch (Settings.Default.AutoSwitchOutput) { case 1: WebHandler.SendCmdAsync("number=" + callNumber); WebHandler.SendKeyAsync("HEADSET"); break; case 2: WebHandler.SendCmdAsync("number=" + callNumber); WebHandler.SendKeyAsync("SPEAKER"); break; default: WebHandler.SendCmdAsync("number=" + callNumber); break; } } }
private void Window_KeyDown(object sender, KeyEventArgs e) { switch (e.Key) { case Key.Up: WebHandler.SendKeyAsync("UP"); break; case Key.Down: WebHandler.SendKeyAsync("DOWN"); break; case Key.Right: WebHandler.SendKeyAsync("RIGHT"); break; case Key.Left: WebHandler.SendKeyAsync("LEFT"); break; case Key.M: WebHandler.SendKeyAsync("MENU"); break; case Key.Enter: WebHandler.SendKeyAsync("ENTER"); break; case Key.Escape: WebHandler.SendKeyAsync("CANCEL"); break; case Key.D: WebHandler.SendKeyAsync("DND"); break; case Key.W: WebHandler.SendKeyAsync("REDIAL"); break; case Key.H: WebHandler.SendKeyAsync("HEADSET"); break; case Key.F1: WebHandler.SendKeyAsync("F1"); break; case Key.F2: WebHandler.SendKeyAsync("F2"); break; case Key.F3: WebHandler.SendKeyAsync("F3"); break; case Key.F4: WebHandler.SendKeyAsync("F4"); break; } }
private void BtnHeadset_Click(object sender, RoutedEventArgs e) { WebHandler.SendKeyAsync("HEADSET"); }
private void BtnSpeaker_Click(object sender, RoutedEventArgs e) { WebHandler.SendKeyAsync("SPEAKER"); }
private void BtnVolumeUp_Click(object sender, RoutedEventArgs e) { WebHandler.SendKeyAsync("VOLUME_UP"); }
private void BtnHold_Click(object sender, RoutedEventArgs e) { WebHandler.SendKeyAsync("F_HOLD"); }
private void BtnTransfer_Click(object sender, RoutedEventArgs e) { WebHandler.SendKeyAsync("TRANSFER"); }
private void BtnDND_Click(object sender, RoutedEventArgs e) { WebHandler.SendKeyAsync("DND"); }