partial void OnPasswordChanged(NSObject sender)
{
this.LoginStatusLabel.StringValue = "logging in...";
this.LoginStatusLabel.Hidden = false;
// monomac bug: animation GUI effect will cause GUI to hang, when backend thread is busy
// this.LoginStatusProgress.StartAnimation(this);
ServerCredentials cred = new ServerCredentials() {
Address = Credentials.Address,
Binding = Credentials.Binding,
UserName = Credentials.UserName,
Password = PasswordText.StringValue
};
PasswordText.Enabled = false;
new TaskFactory().StartNew(() => {
try{
cred.GetRepositories();
InvokeOnMainThread(()=> {
lock(loginLock)
{
if(!isClosed)
this.LoginStatusLabel.StringValue = "login successful";
}
});
}catch(Exception e) {
InvokeOnMainThread(() => {
lock (loginLock)
{
if(!isClosed)
this.LoginStatusLabel.StringValue = "login failed: " + e.Message;
}
});
}
InvokeOnMainThread(() => {
lock (loginLock)
{
PasswordText.Enabled = true;
if(!isClosed)
this.LoginStatusProgress.StopAnimation(this);
}
});
});
}