private void Click_Menu_Color(object sender, RoutedEventArgs e) { var cw = new StatusColorEditor(); cw.ShowInTaskbar = false; cw.Owner = System.Windows.Application.Current.MainWindow; cw.Show(); }
/// <summary> /// Set status bar colors based on the settings loaded /// </summary> public void InitStatusBar() { this.StatusIdle.Background = StatusColorEditor.GetStatusColor(PhoneStatusCodes.Idle); this.StatusRinging.Background = StatusColorEditor.GetStatusColor(PhoneStatusCodes.Ringing); this.StatusOutOfService.Background = StatusColorEditor.GetStatusColor(PhoneStatusCodes.OutOfService); this.StatusBusy.Background = StatusColorEditor.GetStatusColor(PhoneStatusCodes.Busy); this.StatusNotExisting.Background = StatusColorEditor.GetStatusColor(PhoneStatusCodes.NotExisting); }
private void SetRangeStatus(int Index, PhoneStatusCodes NewStatus) { if (Index < 0 || Index > 9) { return; } if (NewStatus < PhoneStatusCodes.NumberOfStatusCodes) { if (Index == 0) { this.StatusText0.Background = StatusColorEditor.GetStatusBrush(NewStatus); } else if (Index == 1) { this.StatusText1.Background = StatusColorEditor.GetStatusBrush(NewStatus); } else if (Index == 2) { this.StatusText2.Background = StatusColorEditor.GetStatusBrush(NewStatus); } else if (Index == 3) { this.StatusText3.Background = StatusColorEditor.GetStatusBrush(NewStatus); } else if (Index == 4) { this.StatusText4.Background = StatusColorEditor.GetStatusBrush(NewStatus); } else if (Index == 5) { this.StatusText5.Background = StatusColorEditor.GetStatusBrush(NewStatus); } else if (Index == 6) { this.StatusText6.Background = StatusColorEditor.GetStatusBrush(NewStatus); } else if (Index == 7) { this.StatusText7.Background = StatusColorEditor.GetStatusBrush(NewStatus); } else if (Index == 8) { this.StatusText8.Background = StatusColorEditor.GetStatusBrush(NewStatus); } else if (Index == 9) { this.StatusText9.Background = StatusColorEditor.GetStatusBrush(NewStatus); } } //unknown status ? Bail out else { return; } CurrentStatusRange[Index] = NewStatus; }
/// <summary> /// Change the status of this phone.It will have different color /// </summary> /// <param name="NewStatus"></param> public void SetStatus(PhoneStatusCodes NewStatus) { if (NewStatus < PhoneStatusCodes.NumberOfStatusCodes) { this.StatusText.Background = StatusColorEditor.GetStatusColor(NewStatus); } //unknown status ? Bail out else { return; } CurrentStatus = NewStatus; }
/* * public void DeleteSave(string IndexCardName) * { * //we never got saved or loaded, there is no need to delete * if (ConfigIndex < 0) * return; * Globals.Config.RemoveConfig(IndexCardName, "Phone #" + ConfigIndex); * Globals.Config.RemoveConfig(IndexCardName, "Name #" + ConfigIndex); * Globals.Config.RemoveConfig(IndexCardName, "Number #" + ConfigIndex); * Globals.Config.RemoveConfig(IndexCardName, "Email #" + ConfigIndex); * Globals.Config.RemoveConfig(IndexCardName, "Comment #" + ConfigIndex); * Globals.Config.RemoveConfig(IndexCardName, "Position x #" + ConfigIndex); * Globals.Config.RemoveConfig(IndexCardName, "Position y #" + ConfigIndex); * Globals.Config.RemoveConfig(IndexCardName, "Font #" + ConfigIndex); * }*/ /// <summary> /// Change the status of this phone.It will have different color /// </summary> /// <param name="NewStatus"></param> public void SetStatus(PhoneStatusCodes NewStatus, string pExtension = "") { //unknown status ? Bail out if (NewStatus >= PhoneStatusCodes.NumberOfStatusCodes2) { return; } if (GetExtension() == "" && NewStatus == PhoneStatusCodes.PHONE_DOESNOT) { return; } //ranges and non ranges are handled differently if (IsRange == false) { CurrentStatus = NewStatus; if (StyleManager.PhoneNumberHasGradientBackground() == true) { this.CellBorder.Background = StatusColorEditor.GetStatusBrushGradient(NewStatus); } else { this.CellBorder.Background = StatusColorEditor.GetStatusBrush(NewStatus); } UpdateTooltipContent(); if (NewStatus == PhoneStatusCodes.PHONE_EXTERNAL) { img_External.Visibility = Visibility.Visible; } else { img_External.Visibility = Visibility.Collapsed; } } else { if (pExtension != "") { int LastDigit = pExtension[pExtension.Length - 1] - '0'; SetRangeStatus(LastDigit, NewStatus); } else { //refresh colors for (int i = 0; i < 9; i++) { SetRangeStatus(i, CurrentStatusRange[i]); } } } }
public NotificationTaskBar(string content, PhoneStatusCodes status) { InitializeComponent(); this.ContentBorder.Background = StatusColorEditor.GetStatusBrush(status); this.PopupContent.Text = content; }
/// <summary> /// This is a global event passed from main window to all children /// </summary> public void OnStatusColorChanged() { this.StatusText.Background = StatusColorEditor.GetStatusColor(CurrentStatus); }