private void ConnectClick(object sender, RoutedEventArgs e) { try { UseHTTPS(); login = api.Login(user.Text, pass.Password, null); connectStatus.Content = login.ResultCodeString(); sessionID.Text = login.SessionID ?? "null"; RememberMe_Checked(RememberMe, null); } catch (Exception ex) { AddMessage("ConnectClick failed. Please check your connection.\r" + ex.Message); } finally { UseHTTP(); } }