private void btnTransfer_Click(object sender, RoutedEventArgs e) { String res = InputBox.GetInput("Transfer To", "Enter a number to transfer to.", ""); if (String.IsNullOrEmpty(res)) { return; } if (call != null) { call.Transfer(res); } }
public override IEnumerable <MenuItem> XFERMenu(Call call, ContextMenu orig_menu) { MenuItem item; var ret = new List <MenuItem>(); bool on_call = call != null; foreach (KeyValuePair <string, string> kvp in number_to_xfer) { item = new MenuItem(); String num = kvp.Key; if (on_call) { item.Click += (s, e) => { orig_menu.IsOpen = false; call.Transfer(num); }; } item.Header = kvp.Value + " (" + num + ")"; ret.Add(item); MenuItem sub_item = new MenuItem(); if (!on_call) { sub_item.Click += edit_xfer_click; sub_item.Header = "Edit Alias"; sub_item.DataContext = kvp; item.Items.Add(sub_item); if (CanDeleteXFER()) { sub_item = new MenuItem(); sub_item.Click += del_xfer_click; sub_item.Header = "Delete Alias"; sub_item.DataContext = kvp; item.Items.Add(sub_item); } } } if (!on_call) { item = new MenuItem(); item.Click += add_xfer_click; item.Header = "Add Transfer Alias"; ret.Add(item); } ModifyXFERMenu(call, orig_menu, ret); return(ret); }
public override void XFERRightClickMenu(Call call, ContextMenu menu) { MenuItem item; bool on_call = call != null; foreach (KeyValuePair <string, string> kvp in number_to_xfer) { item = new MenuItem(); String num = kvp.Key; if (on_call) { item.Click += (s, e) => { menu.IsOpen = false; call.Transfer(num); }; } item.Header = kvp.Value + " (" + num + ")"; menu.Items.Add(item); MenuItem sub_item = new MenuItem(); if (!on_call) { sub_item.Click += edit_xfer_click; sub_item.Header = "Edit Alias"; sub_item.DataContext = kvp; item.Items.Add(sub_item); if (CanDeleteXFER()) { sub_item = new MenuItem(); sub_item.Click += del_xfer_click; sub_item.Header = "Delete Alias"; sub_item.DataContext = kvp; item.Items.Add(sub_item); } } } if (!on_call) { item = new MenuItem(); item.Click += add_xfer_click; item.Header = "Add Transfer Alias"; menu.Items.Add(item); } ModifyXFERRightClickMenu(call, menu); }
public override void XFERRightClickMenu(Call call, ContextMenu menu) { MenuItem item; bool on_call = call != null; foreach (KeyValuePair<string, string> kvp in number_to_xfer) { item = new MenuItem(); String num = kvp.Key; if (on_call) { item.Click += (s, e) => { menu.IsOpen = false; call.Transfer(num); }; } item.Header = kvp.Value + " (" + num + ")"; menu.Items.Add(item); MenuItem sub_item = new MenuItem(); if (!on_call) { sub_item.Click += edit_xfer_click; sub_item.Header = "Edit Alias"; sub_item.DataContext = kvp; item.Items.Add(sub_item); if (CanDeleteXFER()) { sub_item = new MenuItem(); sub_item.Click += del_xfer_click; sub_item.Header = "Delete Alias"; sub_item.DataContext = kvp; item.Items.Add(sub_item); } } } if (!on_call) { item = new MenuItem(); item.Click += add_xfer_click; item.Header = "Add Transfer Alias"; menu.Items.Add(item); } ModifyXFERRightClickMenu(call, menu); }