/* 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 + ")"; contact = contact.Replace("|", "\r\n"); // Add to DB HistoryDatabase db = HistoryDatabase.getInstance(); db.Add(number, contact); textBoxCallState.Text = incall.StateId.ToString(); textBoxLastCallNumber.Text = number; textBoxLastCallDate.Text = DateTime.Now.ToString(); notifyIcon1.BalloonTipTitle = "Входящий звонок: " + number; notifyIcon1.BalloonTipText = contact; notifyIcon1.BalloonTipIcon = ToolTipIcon.Info; notifyIcon1.ShowBalloonTip(30); /* * // Send Busy * ICallProxyInterface proxy = CallManager.StackProxy.createCallProxy(); * proxy.serviceRequest((int)EServiceCodes.SC_CFB, ""); * proxy.endCall(); */ }
private void InitializeList() { listView1.Items.Clear(); HistoryDatabase db = HistoryDatabase.getInstance(); List <HistoryRow> list = db.getAll(); foreach (var item in list) { string[] arr = new string[4]; arr[0] = item.getId().ToString(); arr[1] = item.getDate(); arr[2] = item.getPhone(); arr[3] = item.getText(); listView1.Items.Add(new ListViewItem(arr)); } }