private bool SaveSettings()
        {
            List <string> UsuariosInvalidos = new List <string>();


            ///GRID ASSINATURAS
            if (dataGridView1.Rows.Count > 0)
            {
                foreach (DataGridViewRow row in dataGridView1.Rows)
                {
                    bool fInsert = true;
                    DataGridViewTextBoxCell  txtNome = (DataGridViewTextBoxCell)(row.Cells[0]);
                    DataGridViewComboBoxCell combo   = (DataGridViewComboBoxCell)(row.Cells[1]);

                    if (txtNome.Tag != null)
                    {
                        var    id       = ((GEDPESSOAS)txtNome.Tag).PES_IDPESSOA;
                        int    idPessoa = (int)id;
                        var    sNome    = txtNome.Value;
                        string chave    = (combo.Value == null) ? "" : combo.Value.ToString();

                        if (chave != "")
                        {
                            string sCpfCertificado = Assinador.BuscaCPFCertificadosValidos(chave);
                            string sVefica         = ACSConfig.GetApp().CPFValidateCertificado;

                            if (sVefica == "YES")
                            {
                                if (sCpfCertificado != "" && ((GEDPESSOAS)txtNome.Tag).PES_CPF != sCpfCertificado)
                                {
                                    fInsert = false;
                                    UsuariosInvalidos.Add("Usuário " + sNome + ", possui um CPF diferente ao do Certificado. Impossível fazer a vinculação do Certificado");
                                }
                            }
                        }

                        if (fInsert)
                        {
                            var fVerifica = DataBase.ACSDataBase.UpdateCertificadoUsuario(idPessoa, chave);
                            if (idPessoa == ACSGlobal.UsuarioLogado.USR_IDPESSOA)
                            {
                                ACSGlobal.UsuarioLogado.USR_SERIALNUMBERCERT = chave;
                            }
                        }
                    }
                }
            }

            ////GRID ASSINATURAS



            ACSConfig.GetStorage().Input  = tbInput.Text;
            ACSConfig.GetStorage().Output = tbOutput.Text;


            if (rbJPG.Checked)
            {
                ACSConfig.GetImages().Format = ImageFormat.Jpeg;
            }
            if (rbPNG.Checked)
            {
                ACSConfig.GetImages().Format = ImageFormat.Png;
            }
            if (rbTIF.Checked)
            {
                ACSConfig.GetImages().Format = ImageFormat.Tiff;
            }

            ACSConfig.GetImages().Resolution = float.Parse(dudResolution.SelectedItem.ToString());

            ACSConfig.GetBarCodeSettings().MaxLength = int.Parse(tbMaxLength.Text);

            ACSConfig.GetScanner().Driver = cbDrivers.Text;

            if (cbDrivers.Text.Contains("Lexmark"))
            {
                ACSMinCapture.Controls.UCImagesManipulation ucImagem = new Controls.UCImagesManipulation(null);
                ucImagem.btnDuplex.Visible = true;
                ucImagem.btnDuplex.Refresh();
            }
            else
            {
                ACSMinCapture.Controls.UCImagesManipulation ucImagem = new Controls.UCImagesManipulation(null);
                ucImagem.btnDuplex.Visible = false;
                ucImagem.btnDuplex.Refresh();
            }

            if (rbPretoBranco.Checked)
            {
                ACSConfig.GetScanner().ScanAs = 0;
            }

            if (rbTonsCinza.Checked)
            {
                ACSConfig.GetScanner().ScanAs = 1;
            }

            if (rbColorido.Checked)
            {
                ACSConfig.GetScanner().ScanAs = 2;
            }


            ACSConfig.GetImages().Brightness       = (int)tbBrightness.Value;
            ACSConfig.GetImages().BrightnessReload = (int)tbBrightness.Value;
            ACSConfig.GetImages().Contrast         = (int)tbContrast.Value;

            ACSConfig.GetNetworkAccesser().Valid    = cbAutentica.Checked;
            ACSConfig.GetNetworkAccesser().Domain   = tbDominio.Text;
            ACSConfig.GetNetworkAccesser().User     = tbUsuario.Text;
            ACSConfig.GetNetworkAccesser().Password = tbSenha.Text;
            if (UsuariosInvalidos.Count > 0)
            {
                foreach (var item in UsuariosInvalidos)
                {
                    WFMessageBox.Show(item, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                return(false);
            }
            return(true);
        }