Esempio n. 1
0
 public void Setup(string source_code, SpectrCondEditor editor)
 {
     Editor = editor;
     Editor.Cond.Compile(source_code);
     Editor.ReInitResultWindow(Editor.Cond);
     ReInitList();
 }
        static public SpectrCondition GetCond(Form master, SpectrCondition src, bool just_setup)
        {
            SpectrCondEditor ed = new SpectrCondEditor();

            ed.JustSetup = just_setup;
            string src_code;

            if (src == null || src.SourceCode == null ||
                src.SourceCode.Trim().Length == 0)
            {
                src_code = SpectrCondition.GetDefaultCondition();
            }
            else
            {
                src_code = src.SourceCode;
            }
            if (ed.chbShowSourceCode.Checked)
            {
                ed.tbSourceCode.Text = src_code;
            }
            else
            {
                ed.scSimpleEditor.Setup(src_code, ed);
            }
            DialogResult dr = ed.ShowDialog(master);

            if (dr == DialogResult.OK)
            {
                return(ed.Cond);
            }
            return(null);
        }