Beispiel #1
0
        private void btNomadicSet_Click(object sender, EventArgs e)
        {
            String output = null;

            if (rbNomadicToOfficePhone.Checked)
            {
                rainbowTelephony.DeactivateNomadicStatus(callback =>
                {
                    if (callback.Result.Success)
                    {
                        output = "Nomadic set to Office Phone";
                    }
                    else
                    {
                        output = String.Format("Not possible to set Nomadic to Office Phone - error:[{0}]", Util.SerializeSdkError(callback.Result));
                        log.LogError(output);
                    }
                    AddStateLine(output);
                });
            }
            else if (rbNomadicToComputer.Checked)
            {
                rainbowTelephony.ActivateNomadicStatusToComputer(callback =>
                {
                    if (callback.Result.Success)
                    {
                        output = "Nomadic set to Computer";
                    }
                    else
                    {
                        output = String.Format("Not possible to set Nomadic to Computer - error:[{0}]", Util.SerializeSdkError(callback.Result));
                        log.LogError(output);
                    }
                    AddStateLine(output);
                });
            }
            else if (rbNomadicToPhoneNumber.Checked)
            {
                String phoneNumber = tbNomadicPhoneNumber.Text;
                rainbowTelephony.ActivateNomadicStatusToPhoneNumber(phoneNumber, callback =>
                {
                    if (callback.Result.Success)
                    {
                        output = String.Format("Nomadic set to [{0}]", phoneNumber);
                    }
                    else
                    {
                        output = String.Format("Not possible to set Nomadic to phone number [{1}] - error:[{0}]", Util.SerializeSdkError(callback.Result), phoneNumber);
                        log.LogError(output);
                    }
                    AddStateLine(output);
                });
            }
        }