Пример #1
0
        private void toolStripButtonExpand_Click(object sender, EventArgs e)
        {
            DetachedEditorDialog dlgEditor = new DetachedEditorDialog(_CompileErrors, (Described <ServerEvent>)comboBoxEvent.SelectedItem);

            dlgEditor.Code            = _Editor.Text;
            dlgEditor.Text            = "Editing: " + textBoxName.Text + " [" + comboBoxEvent.SelectedItem.ToString() + "]";
            dlgEditor.CurrentPosition = _Editor.CurrentPos;
            dlgEditor.AdditionalReferences.AddRange(GetReferences());
            dlgEditor.AdditionalNamespaces.AddRange(GetNamespaces());
            dlgEditor.Parameters = labelParameters.Text;
            if (dlgEditor.ShowDialog(this) == DialogResult.OK)
            {
                CurrentItem.Rule.Script = _Editor.Text = dlgEditor.Code;
                _Editor.CurrentPos      = dlgEditor.CurrentPosition;
                if (dlgEditor.CompileErrors.Count > 0)
                {
                    _CompileErrors.Clear();
                    foreach (var kvp in dlgEditor.CompileErrors)
                    {
                        _CompileErrors.Add(kvp.Key, kvp.Value);
                    }
                    _Editor.ClearAllAnnotations();
                    _Editor.DisplayErrors(_CompileErrors);
                }
            }
        }
Пример #2
0
 private void DetachedEditorDialog_Load(object sender, EventArgs e)
 {
     Application.Idle += new EventHandler(Application_Idle);
     _Editor.DisplayErrors(_CompileErrors);
 }