private void OnSelectExtension() { string SelectedExtension = (string)Extensions.SelectedValue; //get this extension and check it's details ForwardStatusStore pn = Globals.ForwardManager.ForwardStatusGet(SelectedExtension); if (pn != null) { if (pn.ForwardType != CallForwardingTypes.CallForwardNone) { ForwardTypes.SelectedIndex = 0; gb_ForwardTo.IsEnabled = true; } else { ForwardTypes.SelectedIndex = 1; gb_ForwardTo.IsEnabled = false; } if (pn.ForwardType == CallForwardingTypes.CallForwardDestination) { rb_Destination.IsChecked = true; rb_VoiceMail.IsChecked = false; } else { rb_Destination.IsChecked = false; rb_VoiceMail.IsChecked = true; } if (pn.DestinationForward != 0) { DestinationExtension.Text = pn.DestinationForward.ToString(); } else { DestinationExtension.Text = ""; } if (pn.VoiceMailForward != 0) { Voicemail.Text = pn.VoiceMailForward.ToString(); } else { Voicemail.Text = ""; } } else { ForwardTypes.SelectedIndex = 0; DestinationExtension.Text = ""; Voicemail.Text = ""; rb_Destination.IsChecked = false; rb_VoiceMail.IsChecked = false; gb_ForwardTo.IsEnabled = false; ForwardTypes.SelectedIndex = 0; } }
private void UpdateTooltipContent() { if (IsRange == false && Extension.Length > 0) { this.StatusText.ToolTip = HiddenTooltip; this.TooltipName.Text = UserName; this.TooltipNote.Text = Note; if (CurrentStatus == PhoneStatusCodes.Busy) { this.TooltipStatus.Text = "Busy"; } else if (CurrentStatus == PhoneStatusCodes.PHONE_EXTERNAL) { this.TooltipStatus.Text = "Busy(external)"; } else if (CurrentStatus == PhoneStatusCodes.Idle) { this.TooltipStatus.Text = "Idle"; } else if (CurrentStatus == PhoneStatusCodes.Ringing) { this.TooltipStatus.Text = "Ringing"; } else if (CurrentStatus == PhoneStatusCodes.PHONE_DOESNOT) { this.TooltipStatus.Text = "Not existing"; } else if (CurrentStatus == PhoneStatusCodes.OutOfService) { this.TooltipStatus.Text = "Out of service"; } /* if (Email != null && Email.Length > 0) * Task.Run(() => { BackgroundUpdateAvailability(); }); * else * TooltipAvail.Text = ""; */ if (img_Forward.Visibility == Visibility.Visible) { ForwardStatusStore fs = Globals.ForwardManager.ForwardStatusGet(GetExtension()); ToolTipForward.Visibility = Visibility.Visible; t_TooltipFrw.Text = "Forwarding to " + fs.DestinationForward.ToString(); } else { ToolTipForward.Visibility = Visibility.Collapsed; } } else { this.StatusText.ToolTip = null; } }
public void OnForwardingChange(ForwardStatusStore fs) { //update the extension to show an arrow if (fs == null || fs.ForwardType == CallForwardingTypes.CallForwardNone) { img_Forward.Visibility = Visibility.Collapsed; } else { img_Forward.Visibility = Visibility.Visible; } //update tooltip UpdateTooltipContent(); }
private void DoDemoUpdate() { //find this random cell and color it this.Dispatcher.Invoke(DispatcherPriority.Normal, (Action)(() => { MainWindow MainObject = (MainWindow)App.Current.MainWindow; if (MainObject == null) { return; } GridContentArea grid = this.DrawArea; int Rows = grid.GetCellsInHeight(); int Cols = grid.GetCellsInWidth(); //get a random cell Random rnd = new Random(); int RandRow = rnd.Next(0, Rows); int RandCol = rnd.Next(0, Cols); PhoneNumber RandomElement = RandomElement = grid.PaintArea.Children.Cast <PhoneNumber>().FirstOrDefault(e => Grid.GetRow(e) == RandRow && Grid.GetColumn(e) == RandCol); if (RandomElement != null) { //try to set random look between simple extension and range /* if (rnd.Next(0, 10) < 5) * RandomElement.SetIsRange(true); * else * RandomElement.SetIsRange(false);*/ //set a random status color int RandStatus = rnd.Next(0, (int)PhoneStatusCodes.NumberOfStatusCodes); if (RandomElement.IsSubscriberRange() == false) { RandomElement.SetStatus((PhoneStatusCodes)RandStatus); } else { RandomElement.SetStatus((PhoneStatusCodes)RandStatus, rnd.Next(0, 9).ToString()); } //set a random extension RandomElement.SetExtension(rnd.Next(0, 9999).ToString()); RandomElement.SetName("Name" + RandomElement.GetExtension().ToString()); //can we see name properly ? if (rnd.Next(0, 10) < 5) { RandomElement.OnToggleShowName(); } //note can be seen in the tooltip RandomElement.SetNote("Topcomment" + RandomElement.GetExtension().ToString()); //absence status can be seen in the tooltip if (rnd.Next(0, 10) < 5) { RandomElement.OnAbsenceStatusUpdate(false); } else { RandomElement.OnAbsenceStatusUpdate(true); } //can we see prefix ? RandomElement.SetPrefix(rnd.Next(0, 9999).ToString()); if (rnd.Next(0, 10) < 5) { RandomElement.OnToggleShowCanonical(); } //try to set random forwarding status ForwardStatusStore fss = new ForwardStatusStore(RandomElement.GetExtension()); if (rnd.Next(0, 10) < 5) { fss.ForwardType = CallForwardingTypes.CallForwardDestination; } else { fss.ForwardType = CallForwardingTypes.CallForwardNone; } RandomElement.OnForwardingChange(fss); } })); }