예제 #1
0
 private void rdSaveToMultipleFiles_CheckedChanged(object sender, EventArgs e)
 {
     ConditionalControls.UnlockHeight(this);
     ConditionalControls.SetVisible(panelSaveSeparator, rdSaveToMultipleFiles.Checked);
     ConditionalControls.SetVisible(rdFilePerScan, !rdSingleScan.Checked && rdSaveToMultipleFiles.Checked);
     ConditionalControls.LockHeight(this);
 }
예제 #2
0
        protected override void OnLoad(object sender, EventArgs eventArgs)
        {
            new LayoutManager(this)
            .Bind(btnCancel, btnOK)
            .RightToForm()
            .Bind(comboLanguages, comboOcrMode)
            .WidthToForm()
            .Activate();

            LoadLanguages();
            comboLanguages.DisplayMember = "Name";
            comboLanguages.ValueMember   = "Code";

            ConditionalControls.UnlockHeight(this);
            ConditionalControls.SetVisible(comboOcrMode, availableModes != null, 8);
            labelOcrMode.Visible = availableModes != null;
            ConditionalControls.LockHeight(this);

            if (appConfigManager.Config.OcrState == OcrState.Enabled)
            {
                checkBoxEnableOcr.Checked = true;
                SetSelectedValue(comboLanguages, appConfigManager.Config.OcrDefaultLanguage ?? "");
                SetSelectedItem(comboOcrMode, appConfigManager.Config.OcrDefaultMode);
                checkBoxRunInBG.Checked = appConfigManager.Config.OcrDefaultAfterScanning;
            }
            else if (appConfigManager.Config.OcrState == OcrState.Disabled)
            {
                checkBoxEnableOcr.Checked    = false;
                comboLanguages.SelectedValue = "";
                comboOcrMode.SelectedValue   = "";
                checkBoxRunInBG.Checked      = false;
            }
            else
            {
                checkBoxEnableOcr.Checked = UserConfigManager.Config.EnableOcr;
                SetSelectedValue(comboLanguages, UserConfigManager.Config.OcrLanguageCode ?? appConfigManager.Config.OcrDefaultLanguage ?? "");
                SetSelectedItem(comboOcrMode, UserConfigManager.Config.OcrMode == OcrMode.Default ? appConfigManager.Config.OcrDefaultMode : UserConfigManager.Config.OcrMode);
                checkBoxRunInBG.Checked = UserConfigManager.Config.OcrAfterScanning ?? appConfigManager.Config.OcrDefaultAfterScanning;
            }

            UpdateView();
        }
예제 #3
0
 private void rdLoadIntoNaps2_CheckedChanged(object sender, EventArgs e)
 {
     ConditionalControls.UnlockHeight(this);
     ConditionalControls.SetVisible(panelSaveTo, !rdLoadIntoNaps2.Checked);
     ConditionalControls.LockHeight(this);
 }
예제 #4
0
 private void rdMultipleScansDelay_CheckedChanged(object sender, EventArgs e)
 {
     ConditionalControls.UnlockHeight(this);
     ConditionalControls.SetVisible(panelScanDetails, rdMultipleScansDelay.Checked);
     ConditionalControls.LockHeight(this);
 }