Ejemplo n.º 1
0
        private void LoadConfig()
        {
            if (!settings.Initialize())
            {
                MessageBox.Show(settings.lastError, Resources.ERROR);
            }

            if (!settings.Open())
            {
                MessageBox.Show(settings.lastError, Resources.ERROR);
            }

            try
            {
                if (!settings.DebugEnabled)
                {
                    int w = this.Width;
                    DebugBox.Hide();
                    MaximumSize = new Size(w, tablePanel3.Bottom + 50);
                }

                this.SigVisible.Checked = settings.VisibleSignature;
            }
            catch (Exception) { }

            // UI
            comboLanguage.SelectedIndex = GetCulture(settings.Language);

            // Signature box content
            Contacttext.Text = settings.Contact;
            Reasontext.Text  = settings.Reason;
            Citytext.Text    = settings.City;
            Countytext.Text  = settings.County;
            Countrytext.Text = settings.Country;
            Indextext.Text   = settings.Index;

            // digidocpp.conf
            if (!conf.Initialize())
            {
                MessageBox.Show(conf.lastError, Resources.ERROR);
                return;
            }
            if (!conf.Open())
            {
                MessageBox.Show(conf.lastError, Resources.ERROR);
                return;
            }

            // DirectoryX509Store
            OpenCertStore(conf.CertStorePath);
        }