//------------------------------------------------------------------------------------- private void richTextBox1_TextChanged(object sender, EventArgs e) { CodeQuery = null; buttonOK.Text = "Компиляция"; buttonOK.Image = global::Sim.AdminForms.Properties.Resources.Compile; if(richTextBox1.Text.Length > 0) buttonOK.Enabled = true; }
//------------------------------------------------------------------------------------- private void buttonOK_Click(object sender, EventArgs e) { try { if(buttonOK.Text == "OK") { this.Hide(); OnDialogClosed(DialogResult.OK); } else { Type t = ((ComboBoxItem<Type>)cbObject.SelectedItem).Key; ValuesPair<PulsarCodeTransfer.CodeQuery,List<string>> query = PulsarCodeTransfer.GetCodeQuery(t, richTextBox1.Text); fdgvErrs.DataSource = new ListBinder(query.Value2); if(query.Value1 != null) { buttonOK.Text = "OK"; buttonOK.Image = global::Sim.AdminForms.Properties.Resources.OK; CodeQuery = query.Value1; } } } catch(Exception Err) { Sim.Controls.ErrorBox.Show(Err); } }