private void NewGalleryForm_Load(object sender, EventArgs e) { foreach (KeyValuePair <string, int> encryptionAlgorithm in CommonWorker.GetAvailableEncryptionAlgorithms()) { comboBoxEncryption.Items.Add(new ComboBoxItem(encryptionAlgorithm.Key, encryptionAlgorithm.Value)); } EnableControls(); }
public ViewForm(string rtf) { InitializeComponent(); richboxSources.Rtf = rtf; pnlLineNo.Paint += (o, c) => { CommonWorker.PaintLineNo(richboxSources, pnlLineNo); }; richboxSources.TextChanged += (o, c) => { pnlLineNo.Invalidate(); }; richboxSources.VScroll += (o, c) => { pnlLineNo.Invalidate(); }; }
private void EnableControls(bool enable = true) { textBoxPassword.Enabled = (enable && comboBoxEncryption.SelectedIndex > 0); buttonOK.Enabled = (enable && CommonWorker.PathNameIsValid(textBoxFilePath.Text) && textBoxName.Text.Length > 0 && (comboBoxEncryption.SelectedIndex == 0 || comboBoxEncryption.SelectedIndex > 0 && textBoxPassword.Text.Length > 0)); }