/// Check Login, Return null if Login failed public UserInfo CheckLogin() { MyInfo.Initialize(Username, SecureAuthentication); if (SecureAuthentication == false) { return(MyInfo.GetInstance()); } // Login Progress Dialog LoginDialog.ProgressDialog dialog = new LoginDialog.ProgressDialog(Password); ResponseType response = (ResponseType)dialog.Run(); string responseMsg = dialog.ResponseMessage; dialog.Destroy(); // Login OK if (response == ResponseType.Ok) { return(MyInfo.GetInstance()); } string title = "Login Error"; if (responseMsg == null) { responseMsg = "Unknown Error..."; } ShowErrorMessage(title, responseMsg); return(null); }
/// Check Login, Return null if Login failed public UserInfo CheckLogin() { MyInfo.Initialize(Username, SecureAuthentication); if (SecureAuthentication == false) { return(MyInfo.GetInstance()); } // Login Progress Dialog LoginProgressDialog dialog = new LoginProgressDialog(Password); ResponseType response = (ResponseType)dialog.Run(); string responseMsg = dialog.ResponseMessage; dialog.Destroy(); // Login OK if (response == ResponseType.Ok) { return(MyInfo.GetInstance()); } WindowUtils.Shake(this, 2); if (responseMsg != null) { Glue.Dialogs.MessageError("Login Error", responseMsg); } return(null); }