コード例 #1
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.Warn(logLine);
                });

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

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

                // Clear "Conference in progress" layout
                conferenceInProgress = null;

                UpdateConferenceInProgress();
            }
        }