private InformationCard PopulateCard() { InformationCard ic = new InformationCard(); ic.CardImage.ImageName = tbCardImage.Text; ic.CardName = tbCardName.Text; ic.CardReference.CardID = tbCardID.Text; ic.CardReference.CardVersion = Convert.ToInt32(tbCardVersion.Text); ic.Issuer = tbIssuer.Text; ic.IssuerName = tbIssuerName.Text; ic.PrivacyNotice = tbPrivacyPolicy.Text; ic.RequireRPIdentification = cbRequireAppliesTo.Checked; ic.TimeExpires = dtpTimeExpires.Value; ic.TimeIssued = dtpTimeIssued.Value; foreach (DataGridViewRow row in dgvClaims.Rows) { CardClaim claim = new CardClaim(); claim.Description = row.Cells["Description"].Value.ToString(); claim.DisplayTag = row.Cells["DisplayTag"].Value.ToString(); claim.Uri = row.Cells["Uri"].Value.ToString(); claim.Value = row.Cells["ClaimValue"].Value.ToString(); ic.SupportedClaimTypeList.Add(claim); } if (cblSAML10.Checked) { TokenType SAML10 = new TokenType(); SAML10.Name = "SAML10"; SAML10.Uri = "urn:oasis:names:tc:SAML:1.0:assertion"; SAML10.Accepted = true; ic.AcceptedTokenTypes.Add(SAML10); } if (cbSAML11.Checked) { TokenType SAML11 = new TokenType(); SAML11.Name = "SAML11"; SAML11.Uri = "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1"; ic.AcceptedTokenTypes.Add(SAML11); } foreach (DataGridViewRow tsRow in dgvTokenServiceList.Rows) { TokenService ts = new TokenService(); ts.EndpointReference.Address = tsRow.Cells["Address"].Value.ToString(); ts.EndpointReference.Identity = tsRow.Cells["Identity"].Value.ToString(); ts.EndpointReference.Mex = tsRow.Cells["Mex"].Value.ToString(); ts.UserCredential.DisplayCredentialHint = tsRow.Cells["DisplayCredentialHint"].Value.ToString(); ts.UserCredential.UserCredentialType = (CredentialType)(tsRow.Cells["CredentialType"].Tag); ts.UserCredential.Value = tsRow.Cells["Value"].Value.ToString(); ic.TokenServiceList.Add(ts); } return(ic); }
private void btnAdd_Click(object sender, EventArgs e) { if (rbStandardClaim.Checked) { _claim = (CardClaim)cboStandardClaims.SelectedItem; } else { _claim = new CardClaim(); _claim.Description = tbDescription.Text; _claim.DisplayTag = tbDisplayTag.Text; _claim.Uri = tbUri.Text; } Close(); }
private void btnAddClaim_Click(object sender, EventArgs e) { AddClaim addClaim = new AddClaim(); CardClaim cardClaim = addClaim.ShowDialog(); DataGridViewRow row = new DataGridViewRow(); DataGridViewTextBoxCell uri = new DataGridViewTextBoxCell(); DataGridViewTextBoxCell displayTag = new DataGridViewTextBoxCell(); DataGridViewTextBoxCell description = new DataGridViewTextBoxCell(); DataGridViewTextBoxCell claimValue = new DataGridViewTextBoxCell(); uri.Value = cardClaim.Uri; displayTag.Value = cardClaim.DisplayTag; description.Value = cardClaim.Description; claimValue.Value = cardClaim.Value; row.Cells.Add(uri); row.Cells.Add(displayTag); row.Cells.Add(description); row.Cells.Add(claimValue); dgvClaims.Rows.Add(row); }
private void btnCancel_Click(object sender, EventArgs e) { _claim = null; Close(); }