private void btnRemoveAll_Click(object sender, EventArgs e)
        {
            List <FileHistory> documentsToRemoveAllSignatures = new List <FileHistory>();

            foreach (FileHistory document in selectedDocuments)
            {
                documentsToRemoveAllSignatures.Add(document);
            }
            frmRemoveDigitalSignatures FormRemoveDigitalSignatures = new frmRemoveDigitalSignatures(documentsToRemoveAllSignatures);

            FormRemoveDigitalSignatures.Owner = (frmManageDigitalSignature)this;
            FormRemoveDigitalSignatures.ShowDialog();
        }
        private void btnRemove_Click(object sender, EventArgs e)
        {
            List <Signers> signaturesInDocumentsToBeRemoved = new List <Signers>();

            foreach (ListViewGroup lvg in lstSigners.Groups)
            {
                if (lvg.Name != "commonSignatures")
                {
                    Signers signers = new Signers();
                    for (int i = 0; i < lvg.Items.Count; i++)
                    {
                        if (lvg.Items[i].Selected)
                        {
                            signers.Path = lvg.Items[0].SubItems[6].Text;

                            Signer sgn = new Signer();
                            sgn.name         = lvg.Items[i].SubItems[0].Text;
                            sgn.issuer       = lvg.Items[i].SubItems[1].Text;
                            sgn.date         = lvg.Items[i].SubItems[2].Text;
                            sgn.serialNumber = lvg.Items[i].SubItems[4].Text;
                            sgn.uri          = lvg.Items[i].SubItems[5].Text;

                            if (!signers.Contains(sgn))
                            {
                                signers.Add(sgn);
                            }
                        }
                    }
                    if (signers.Count > 0)
                    {
                        signaturesInDocumentsToBeRemoved.Add(signers);
                    }
                }
                else
                {
                    Signers signers = new Signers();
                    signers.Path = "commonSignatures";

                    for (int i = 0; i < lvg.Items.Count; i++)
                    {
                        if (lvg.Items[i].Selected)
                        {
                            Signer sgn = new Signer();
                            sgn.name         = lvg.Items[i].SubItems[0].Text;
                            sgn.issuer       = lvg.Items[i].SubItems[1].Text;
                            sgn.date         = lvg.Items[i].SubItems[2].Text;
                            sgn.serialNumber = lvg.Items[i].SubItems[4].Text;

                            if (!signers.Contains(sgn))
                            {
                                signers.Add(sgn);
                            }
                        }
                    }
                    if (signers.Count > 0)
                    {
                        signaturesInDocumentsToBeRemoved.Add(signers);
                    }
                }
            }
            List <FileHistory> documentsToRemoveSignatures = new List <FileHistory>();

            foreach (FileHistory document in selectedDocuments)
            {
                documentsToRemoveSignatures.Add(document);
            }
            frmRemoveDigitalSignatures FormRemoveDigitalSignatures = new frmRemoveDigitalSignatures(documentsToRemoveSignatures, signaturesInDocumentsToBeRemoved);

            FormRemoveDigitalSignatures.Owner = (frmManageDigitalSignature)this;
            FormRemoveDigitalSignatures.ShowDialog();
        }