private void Button_Click_1(object sender, RoutedEventArgs e) { Database db = new Database(); db.AddCall("test Name", "999-999-9999"); DataContext = new CallViewModel(); }
/// <summary> /// Handles the Click event of the buttonSpawn control. /// </summary> /// <param name = "sender">The source of the event.</param> /// <param name = "e">The <see cref = "System.Windows.RoutedEventArgs" /> instance containing the event data.</param> //private void buttonSpawn_Click(object sender, RoutedEventArgs e) //{ // string path = GetType().Assembly.Location; // try // { // Process.Start(path, "those are the other application arguments"); // } // catch (Exception exc) // { // MessageBox.Show(this, "An exception occurred while spawning another application" + Environment.NewLine + exc); // } //} private void Window_Loaded(object sender, RoutedEventArgs e) {DataContext = new CallViewModel(); this.m_Provider = new HotKeyProvider(); this.m_Provider.HotKeyPressed += m_Provider_HotKeyPressed; var key1 = m_Provider.Register(ModifierKeys.None, Key.F6); }
/* private void OnCallStateChanged(int callId, ESessionState callState, string info) { IStateMachine state = CallManager.CallList[callId]; number = state.CallingNumber; textBoxCallState.Text = number; string contact = contacts.lookup(number); if (contact != "") number = contact + " (" + number + ")"; notifyIcon1.BalloonTipTitle = "Eingehender Anruf"; notifyIcon1.BalloonTipText = "Von: " + number + "\r\n" + info; notifyIcon1.BalloonTipIcon = ToolTipIcon.Info; notifyIcon1.ShowBalloonTip(30); } */ private void OnIncomingCall(int sessionId, string number, string info) { incall = CallManager.getCall(sessionId); //string contact = contacts.lookup(number); //if (contact != "") // number = contact + " (" + number + ")"; CallStatus.Content = incall.StateId.ToString(); // TODO put the code here to put the call in the DB Database db = new Database(); string name = incall.CallingName; db.AddCall(name, number); DataContext = new CallViewModel(); //textBoxLastCallNumber.Text = number; //textBoxLastCallDate.Text = DateTime.Now.ToString(); notifyIcon1.BalloonTipTitle = "New Call"; notifyIcon1.BalloonTipText = "From: " + name + " " + number + "\r\n" + info; notifyIcon1.BalloonTipIcon = ToolTipIcon.Info; notifyIcon1.ShowBalloonTip(30); /* // Send Busy ICallProxyInterface proxy = CallManager.StackProxy.createCallProxy(); proxy.serviceRequest((int)EServiceCodes.SC_CFB, ""); proxy.endCall(); */ }