Пример #1
0
 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;
 }
Пример #2
0
        /*
         *      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]);
                    }
                }
            }
        }
Пример #3
0
 public NotificationTaskBar(string content, PhoneStatusCodes status)
 {
     InitializeComponent();
     this.ContentBorder.Background = StatusColorEditor.GetStatusBrush(status);
     this.PopupContent.Text        = content;
 }