Revision 06f11e8b trunk/Pithos.Client.WPF/Preferences/AddAccountViewModel.cs
b/trunk/Pithos.Client.WPF/Preferences/AddAccountViewModel.cs | ||
---|---|---|
198 | 198 |
} |
199 | 199 |
} |
200 | 200 |
|
201 |
private string _validationMessage; |
|
202 |
public string ValidationMessage |
|
203 |
{ |
|
204 |
get { return _validationMessage; } |
|
205 |
set |
|
206 |
{ |
|
207 |
_validationMessage = value; |
|
208 |
NotifyOfPropertyChange(()=>ValidationMessage); |
|
209 |
} |
|
210 |
} |
|
201 | 211 |
|
202 | 212 |
private bool _isWorking; |
203 | 213 |
public bool IsWorking |
... | ... | |
251 | 261 |
{ |
252 | 262 |
try |
253 | 263 |
{ |
254 |
SetBusy("Validating Credentials",""); |
|
255 |
var client = new CloudFilesClient(AccountName, Token) {AuthenticationUrl = CurrentServer};
|
|
256 |
var containers = await TaskEx.Run(()=> |
|
264 |
SetBusy("Validating Credentials", "");
|
|
265 |
var client = new CloudFilesClient(AccountName, Token) { AuthenticationUrl = CurrentServer };
|
|
266 |
var containers = await TaskEx.Run(() =>
|
|
257 | 267 |
{ |
258 | 268 |
client.Authenticate(); |
259 | 269 |
return client.ListContainers(AccountName); |
260 | 270 |
}); |
261 |
HasValidCredentials = true; |
|
271 |
HasValidCredentials = true; |
|
272 |
ValidationMessage = "Credentials Validated"; |
|
273 |
} |
|
274 |
/* |
|
275 |
catch (AggregateException exc) |
|
276 |
{ |
|
277 |
exc.Handle(ex=> |
|
278 |
{ |
|
279 |
HasValidCredentials = false; |
|
280 |
MessageBox.Show("The account is not valid", "Account Error", MessageBoxButton.OK, MessageBoxImage.Stop); |
|
281 |
}); |
|
262 | 282 |
} |
283 |
*/ |
|
263 | 284 |
catch (Exception ex) |
264 | 285 |
{ |
265 | 286 |
HasValidCredentials = false; |
266 | 287 |
MessageBox.Show("The account is not valid", "Account Error", MessageBoxButton.OK, MessageBoxImage.Stop); |
267 |
throw;
|
|
288 |
ValidationMessage = "Credentials validation failed";
|
|
268 | 289 |
} |
269 | 290 |
finally |
270 | 291 |
{ |
Also available in: Unified diff