/// <summary> /// Refresh the cached list of tanks. /// </summary> private void RefreshTankList() { if (tankListNeedsRefresh) { tankList = session.GetTankList(); tankListNeedsRefresh = false; } }
/// <summary> /// Intercepts the login attempt in order to provide some internal handling. /// </summary> /// <param name="result">Result of the login attempt.</param> /// <param name="session">Session proxy, if one exists.</param> /// <param name="e">Exception thrown from the callback.</param> private void LoginCallback(Result <MainSessionPrx> result) { System.Exception e = result.Exception; if (result.Success) { if (KeepAlive) { keepAliveTimer = new Timer(new TimerCallback(OnKeepAlive), null, KeepAliveInterval, KeepAliveInterval); } session = result.ReturnedResult; session.GetTankList(); //session = MainSessionPrxHelper.uncheckedCast(session.ice_router(router)); pinger = new Pinger(session); } else { logger.Error("LoginCallback() Login attempt failed: {0}", e); if (e is PermissionDeniedException) { PermissionDeniedException ex = (PermissionDeniedException)e; e = new LoginFailedException(ex.reason); } else { e = new LoginFailedException("Unable to login."); } result.Exception = e; } remoteCallback(new Result(result.Success, session, result.Exception)); remoteCallback = null; }