Example #1
0
        private void RainbowApplication_ConnectionStateChanged(object sender, Rainbow.Events.ConnectionStateEventArgs e)
        {
            // Add info about connection state
            UpdateLoginButton(e.State);
            AddStateLine($"Connection state changed: {e.State}");

            if (e.State == ConnectionState.Connected)
            {
                InvokeOnMainThread(() => box.Hidden = false);

                GetAllContacts();
                GetAllConversations();
                GetAllPresence();
            }
            else if (e.State == ConnectionState.Disconnected)
            {
                InvokeOnMainThread(() =>
                {
                    box.Hidden         = true;
                    boxMessages.Hidden = true;
                });

                if (rainbowContactsList != null)
                {
                    rainbowContactsList.Clear();
                    UpdateContactsCombobox();
                }

                if (rainbowConvList != null)
                {
                    rainbowConvList.Clear();
                    UpdateConversationsCombobox();
                }
            }
        }
Example #2
0
        private void RainbowApplication_ConnectionStateChanged(object sender, Rainbow.Events.ConnectionStateEventArgs e)
        {
            // Add info about connection state
            AddStateLine($"ConnectionStateChanged:{e.State}");
            UpdateLoginButton(e.State);

            // Update layout since we are not connected to the server
            if (e.State != Rainbow.Model.ConnectionState.Connected)
            {
                RainbowTelephony_TelephonyStatusUpdated(this, new TelephonyStatusEventArgs(false));

                // Need default constructor in SDK - to add in new release
                RainbowTelephony_CallForwardStatusUpdated(this, new CallForwardStatusEventArgs(new CallForwardStatus()));
                RainbowTelephony_NomadicStatusUpdated(this, new NomadicStatusEventArgs(new NomadicStatus()));
            }
        }
        private void RbApplication_ConnectionStateChanged(object sender, Rainbow.Events.ConnectionStateEventArgs e)
        {
            switch (e.State)
            {
            case ConnectionState.Connected:
                ViewModel.Connect = "Connecting";
                break;

            case ConnectionState.Connecting:
                ViewModel.Connect = "Connecting";
                break;

            case ConnectionState.Disconnected:
                ViewModel.Connect = "Connect";

                ViewModel.IsBusy = false;
                break;
            }
        }
Example #4
0
        private void RainbowApplication_ConnectionStateChanged(object sender, Rainbow.Events.ConnectionStateEventArgs e)
        {
            // Add info about connection state
            AddStateLine($"ConnectionStateChanged:{e.State}");
            UpdateLoginButton(e.State);

            // Update layout since we are not connected to the server
            if (e.State == Rainbow.Model.ConnectionState.Connected)
            {
                rainbowBubbles.GetAllBubbles(callbackBubbles =>
                {
                    string logLine;
                    if (callbackBubbles.Result.Success)
                    {
                        logLine = String.Format("Nb Bubbles:{0}", callbackBubbles.Data.Count);
                    }
                    else
                    {
                        logLine = String.Format("Impossible to get Bubbles list:\r\n{0}", Util.SerializeSdkError(callbackBubbles.Result));
                    }
                    AddStateLine(logLine);
                    log.LogWarning(logLine);
                });

                // Check permissions
                UpdateConferenceAvailable(rainbowBubbles.ConferenceAllowed());
                UpdatePersonalConferenceAvailable(rainbowBubbles.PersonalConferenceAllowed());

                // Update "Conference in progress"
            }
            else
            {
                // Reset permissions
                UpdateConferenceAvailable(false);
                UpdatePersonalConferenceAvailable(false);

                // Clear "Conference in progress" layout
                conferenceInProgress = null;
                UpdateConferenceInProgress();
            }
        }