Пример #1
0
 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();
 }
Пример #2
0
        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(); };
        }
Пример #3
0
 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));
 }