private void _modelAuth_LoadUserComplete(object sender, LoadUserOperationEventArgs e) { try { if (e.HasError) { MessageCustomize.Show("Main: " + e.Error.Message + "-" + e.Error.StackTrace); ErrorProcess(); } else { if (e.LoginOp.User.Identity.Name == string.Empty) { CallDialog.Show(this, ViewTypes.LoginView, c => { if (c == MessageBoxResult.OK) _modelAuth.LoadUserAsync(); }); } else { _itemLogin = e.LoginOp.User as LoginUser; ReloadData(); } } } catch (Exception ex) { MessageCustomize.Show(ex.Message); ErrorProcess(); } }
public override void Cleanup() { if (_modelAuth != null) { _modelAuth.LoginComplete -= new EventHandler<LoginOperationEventArgs>(_modelAuth_LoginComplete); _modelAuth = null; } _itemEdit = null; if (_dialogSended != null) _dialogSended = null; base.Cleanup(); }