Esempio n. 1
0
        private void UpdateUI()
        {
            bool have_user        = Account.UserName != null;
            bool have_session_key = Account.SessionKey != null;

            if (have_session_key)
            {
                LastSessionKeySchema.Set(Account.SessionKey);
                LastIsSubscriberSchema.Set(Account.Subscriber);
            }

            if (have_user)
            {
                SetUserName(Account.UserName);
            }
            else
            {
                ClearChildSources();
            }

            if (Connection.Connected)
            {
                HideStatus();
            }
            else
            {
                SetStatus(RadioConnection.MessageFor(Connection.State), Connection.State != ConnectionState.Connecting, Connection.State);
            }

            OnUpdated();
        }
 private void UpdateUI(ConnectionState state)
 {
     if (state == ConnectionState.Connected)
     {
         HideStatus();
         if (this == ServiceManager.SourceManager.ActiveSource)
         {
             TuneAndLoad();
         }
     }
     else
     {
         track_model.Clear();
         SetStatus(RadioConnection.MessageFor(state), state != ConnectionState.Connecting, state);
         OnUpdated();
     }
 }