Esempio n. 1
0
        /// <summary>
        /// Compile scenarios into assembly
        /// </summary>
        /// <param name="scenarioItems">scenario list</param>
        public void ConstructExecutor(IList <ScenarioItem> scenarioItems)
        {
            if (scriptsVersion == -1)
            {
                scriptsVersion = AppSettings.GetScriptsVersion();
            }

            GetLogger().Info("Scripts compiling.");
            compiledAssembly = ScriptsCompiling.CompileAssembly(scenarioItems,
                                                                Path.GetFullPath(AppSettings.GetApplicationDataPath() + "ScriptSource.cs"));
        }
Esempio n. 2
0
        protected void OnScriptingValidate(object source, ServerValidateEventArgs args)
        {
            ScenarioItem item = new ScenarioItem();

            item.scriptingExpression = args.Value;
            item.id = 0;
            List <ScenarioItem> list = new List <ScenarioItem>();

            list.Add(item);
            try
            {
                ScriptsCompiling.CompileAssembly(list, null);
            }
            catch (CompileErrorException e)
            {
                args.IsValid          = false;
                CustomValidator2.Text = e.Message;
            }
        }