private void service_GetAdminConfigurationCompleted(object sender, GetAdminConfigurationCompletedEventArgs e) { LoginButton.IsEnabled = true; if (e.Result == null || e.Result.MongodbAdminDatabaseConfigurationItems == null || string.IsNullOrEmpty(e.Result.UserName)) { //为了防止点击多次导致触发多次Close事件 MessageBox.Show("认证失败!"); return; } else { service.LogAsync(new OperationLog { AccountName = e.Result.UserName, AccountRealName = e.Result.RealName, CategoryName = "", DatabaseName = "", TableName = "", Action = "登陆", ActionMemo = "" }); this.Tag = e.Result; this.Close(); } }