Example #1
0
        private void UpdateCallForwardStatus(CallForwardStatus callForwardStatus)
        {
            // We can update this compoent only if we are in the from thread
            if (cbCallFwd.InvokeRequired)
            {
                CallForwardStatusArgReturningVoidDelegate d = new CallForwardStatusArgReturningVoidDelegate(UpdateCallForwardStatus);
                this.Invoke(d, new object[] { callForwardStatus });
            }
            else
            {
                Boolean available   = false;
                Boolean activated   = false;
                Boolean toMV        = false;
                Boolean VMAvailable = false;
                String  phoneNumber = "";
                if (callForwardStatus != null)
                {
                    available   = callForwardStatus.Available;
                    activated   = callForwardStatus.Activated;
                    toMV        = callForwardStatus.VoiceMail;
                    phoneNumber = callForwardStatus.PhoneNumber;

                    VMAvailable = rainbowTelephony.VoiceMailAvailable();
                }

                cbCallFwd.Checked = available;
                gbCallFwd.Enabled = available;

                if (available)
                {
                    // Does the VM is available ?
                    rbCallFwdToVm.Enabled = VMAvailable;

                    if (toMV)
                    {
                        rbCallFwdToVm.Checked = true;
                    }
                    else if (!String.IsNullOrEmpty(phoneNumber))
                    {
                        rbCallFwdToPhoneNumber.Checked = true;
                        tbCallFwdPhoneNumber.Text      = phoneNumber;
                    }
                    else
                    {
                        rbCallFwdDisable.Checked = true;
                    }
                }
                else
                {
                    rbCallFwdDisable.Checked = true;
                    rbCallFwdToVm.Enabled    = true;
                }
            }
        }