Beispiel #1
0
 public ScriptView()
 {
     InitializeComponent();
     TabText = "脚本";
     Editor  = JintCreator.CreateEditor(AppContext.Current);
     this.Controls.Add(Editor);
 }
Beispiel #2
0
        static void textEditor_RunBefore(object sender, EventArgs e)
        {
            codeRichEditor textEditor = sender as codeRichEditor;
            JintEngine     jint       = textEditor.JintEngine;

            WatiN.Core.Browser browser = new BrowserWindow(context.Browser);
            jint.SetParameter("ie", new JsBrowser(browser));
            jint.SetParameter("$", new Q(context, browser));
            jint.SetFunction("getMapValue", new Jint.Delegates.Func <string, string>(getMapValue));
            //jint.SetFunction("listprint", new Action<string>(listprint));
            //jint.SetFunction("tableprint", new Action<string>(tableprint));
            textEditor.FindForm().Tag = browser;
        }
Beispiel #3
0
        static public codeRichEditor CreateEditor(IAppContext appcontext)
        {
            context = appcontext;
            JintEngine     jint       = JintCreator.Create();
            codeRichEditor textEditor = new codeRichEditor();

            textEditor.Browser = context.Browser;

            textEditor.JintEngine = jint;
            textEditor.Dock       = DockStyle.Fill;
            textEditor.TmpRead();
            textEditor.RunBefore += new EventHandler(textEditor_RunBefore);
            return(textEditor);
        }