Beispiel #1
0
        /// <summary>
        /// Callback method which will perform a new login to refresh the token
        /// </summary>
        /// <param name="state">Not used</param>
        private void TokenExpireTimer_Callback(Object state)
        {
            try
            {
                var loginInfo = Login();

                if (String.IsNullOrEmpty(loginInfo.Token))
                {
                    throw new Exception("Got blank token when trying to refresh");
                }

                OnTokenRefreshed.Invoke(this, loginInfo.Token);
            }
            catch (Exception e)
            {
                CancelCallbackTimer();
                throw new Exception("Error refreshing token: " + e.Message);
            }
        }
 private void _connection_OnTokenRefreshed(object sender, string e)
 {
     OnTokenRefreshed.Invoke(this, e);
 }